Al-Ḥākim was born on Thursday, 3 Rābi'u l-Awwal in 985 (375 A.H.). His father, caliph al-‘Azīz bil-Lāh, had two consorts. One was an umm al-walad who is only known by the title as-Sayyidah al-‘Azīziyyah or al-‘Azīzah (d. 385/995).

Al-‘Azīzah is considered to be the mother of Sitt al-Mulk, one of the most famous women in Islamic history, who had a stormy relationship with her half-brother al-Ḥākim and may have had him murdered. Some, such as the Crusader chronicler William of Tyre, claimed that al-‘Azīzah was also the mother of Caliph al-Ḥākim, though most historians dismiss this. She was a Melkite Christian whose two brothers were appointed patriarchs of the Melkite Church by Caliph al-‘Azīz. Different sources say either one of her brothers or her father was sent by al-‘Azīz as an ambassador to Sicily.

Al-Ḥākim's father had intended the eunuch Barjawan to act as regent until Al-Ḥākim was old enough to rule by himself. Ibn 'Ammar and the Qadi Muhammad ibn Nu'man were to assist in the guardianship of the new caliph. Instead, al-Hasan ibn 'Ammar (the leader of the Kutama) immediately seized the office of wasīta "chief minister" from 'Īsa ibn Nestorius. At the time the office of sifāra "secretary of state" was also combined within that office. Ibn 'Ammar then took the title of Amīn ad-Dawla "the one trusted in the empire". This was the first time that the term "empire" was associated with the Fatimid state.

In 1004 Al-Hakim decreed that the Christians could no longer celebrate Epiphany or Easter.

In the area of education and learning, one of Hakim's most important contributions was the founding in 1005 of the Dar al-Alem (House of Knowledge) or Dar al-Hikma (House of Wisdom). A wide range of subjects ranging from the Qur'an and hadith to philosophy and astronomy were taught at the Dar al-alem, which was equipped with a vast library. Access to education was made available to the public and many Fatimid da'is received at least part of their training in this major institution of learning which served the Ismaili da'wa (mission) until the downfall of the Fatimid dynasty.

From 996 to 1006 when most of the executive functions of the Khalif were performed by his advisors, the Shiite al-Ḥākim "behaved like the Shiite khalifs, who he succeeded, exhibiting a hostile attitude with respect to Sunni Muslims, whereas the attitude toward 'People of the Book' – Jews and Christians – was one of relative tolerance, in exchange for the jizya tax.

Al-Ḥākim's destruction of the Church of the Holy Sepulchre in 1009.

Al-Ḥākim's most rigorous and consistent opponent was the Abbāsid Caliphate in Baghdad, which sought to halt the influence of Ismailism. This competition led to the Baghdad Manifesto of 1011, in which the Abbāsids claimed that the line al-Ḥākim represented did not legitimately descend from 'Alī. Al-Ḥākim's reign was characterized by general unrest. The Fatimid army was troubled by a rivalry between two opposing factions, the Turks and the Berbers.

From 1007 to 1012 "there was a notably tolerant attitude toward the Sunnis and less zeal for Shiite Islam, while the attitude with regard to the 'People of the Book' was hostile, apparently outraged by what he regarded as the fraud practiced by the monks in the "miraculous" Descent of the Holy Fire, celebrated annually at the church during the Easter Vigil. The chronicler Yahia noted that "only those things that were too difficult to demolish were spared." Processions were prohibited, and a few years later all of the convents and churches in Palestine were said to have been destroyed or confiscated. It was only in 1042 that the Byzantine Emperor Constantine IX undertook to reconstruct the Holy Sepulchre with the permission of Al-Hakim's successor.

Al-Ḥākim ultimately allowed the unwilling Christian and Jewish converts to Islam to return to their faith and rebuild their ruined houses of worship. Indeed, from 1012 to 1021 al-Ḥākim became more tolerant toward the Jews and Christians and hostile toward the Sunnis. Ironically he developed a particularly hostile attitude with regard to the Muslim Shiites. It was during this period, in the year 1017, that the unique religion of the Druze began to develop as an independent religion based on the revelation (Kashf) of al-Ḥākim as divine.

In the final years of his reign, Hakim displayed a growing inclination toward asceticism and withdrew for meditation regularly. On the night of 12/13 February 1021 and at the age of 35, Hakim left for one of his night journeys to the Mokattam hills outside of Cairo, and never returned. A search found only his donkey and bloodstained garments. The disappearance has remained a mystery, though it is likely that his sister Sitt al-Mulk arranged for his assassination, being opposed to his intolerant politics. Al-Ḥākim was succeeded by his young son Ali az-Zahir under the regency of Sitt al-Mulk.