A magocracy is a form of civil leadership only present in fantasy settings; derived from the Latin word "Magos" (literally "wise man", but more commonly known as "mage" or "wizard") and Greek word "Κράτος" ("Power"), it is a government in which magic-users rule and the ability to perform magic is essential to be a member of the leadership caste.
Note that this is different to the ultimate ruler being a magic-user; to be a magocracy, every true authority figure must be some sort of magic-user.
Most settings will specify magocracies as being led by arcane spellcasters; because of the usual relationship between a god and a wielder of divine magic, divine magocracies tend to be indistinguishable in many practical ways from the common theocracy. Magocracies dominated by psionics-users are sometimes referred to as psiocracies instead.
For obvious reasons, this sort of government is particularly common in high-fantasy settings like Dungeons & Dragons. Canonical magocracies include Alphatia on Mystara, Halruaa in the Forgotten Realms and Aundair in Eberron.