In J.R.R. Tolkien’s legendarium, Gandalf is a Maia, an immortal spirit who serves the Valar.
Gandalf belongs to the order of beings known in Valinor as the Istari, or Wizards. He was sent to Middle-earth in the Third Age to oppose Sauron and encourage its peoples to resist evil. His mission was not to rule Middle-earth or defeat Sauron by force alone, but to guide and inspire others.
Readers sometimes classify Gandalf as a wizard, elf, or god because of his appearance and powers. “Wizard” is his role in Middle-earth, while Maia identifies his deeper nature. The Valar are greater divine powers; Gandalf is not one of them.
His original name in Valinor was Olórin. After falling in battle with the Balrog, he returned as Gandalf the White, symbolizing renewed authority and a changed mission.