Power in Arda tends to be of the soft sort, usually the ability to compel, influence or control the wills and attitudes of others, rather than flinging fireballs and whatnot. Raw elemental power, of the kind associated with D&D and its lineage, is reserved for the Valar, basically the higher level angels of Tolkienverse. Gandalf belong to the Maiar, the servitors of the Valar or basically lesser angels like cupids. As a wizard in Middle Earth he's probably less powerful than, say, Moses. However as a pure Maia he'd likely be greater or on par with Moses in his ability to manipulate the world.
That said the defining attribute of Tolkienverse is that it's not very rigorous; though I argue for Gandalf's true strength it's more of an estimation than a recounting of feats attributed to the Maiar (of which there are few). Tolkien envisioned Silmarillion as a Bible of sorts for Middle Earth and in that folkloric context Gandalf is on the level of miracle workers, powerful djinni, nature spirits and so forth.