Hakim's grandfather migrated from the Gaya district of Bihar to Kolkata and started his business. His father, Abdul Hakim, was a law officer for the Kolkata Port Trust. Hakim's mother, Manika Mukhopadhyay is a Hindu and was an assistant head-mistress of a school in Kolkata. Her ancestral house is in Faridpur district, Bangladesh. He is married to Ismat Hakim. They have three daughters—Priyadarshini, Shabba and Afsha. They live in Chetla, a neighborhood of South Kolkata. He is nicknamed Bobby after the Australian cricketer Bobby Simpson. Hakim graduated from Heramba Chandra College with a degree in commerce. He is the organizer-in-chief of the Chetla Agrani Durga Puja committee.
On 20 November 2018, Sovan Chatterjee, then mayor of Kolkata, resigned as a cabinet minister. Two days later, he resigned from the post of the mayor of Kolkata. Subsequently, Trinamool Congress announced that Hakim would be their mayoral candidate. The state government passed the Kolkata Municipal Corporation Bill, 2018. This allows a candidate who is not a member of the Kolkata Municipal Corporation to be appointed mayor of the city, provided they are elected to the same within a period of six months. On 28 November 2018, Hakim filed his nomination. The following day the Bharatiya Janata Party announced Mina Debi Purohit as their mayoral candidate. He secured 121 votes while Purohit received five votes; Hakim was elected mayor. He became the first Muslim since the independence of India to be elected mayor of Kolkata. On getting elected, Hakim said that "pollution and environment are two areas" on which he would like to work. He also setup a WhatsApp number, promising to act on complaints received on that mobile number. Making Kolkata cleaner and greener, ensuring a continuous supply of drinking water to the city, building toilets in slums and making the slums "model residential areas" were his priorities as mayor. In January 2019, it was announced that Hakim would contest ward no. 82 of the Kolkata Municipal Corporation. In a by-election, he won the ward and defeated his nearest rival Jiban Sen of the Bharatiya Janata Party by a margin of 13,987 votes; Hakim received 16,564 votes.
Controversies
In 2016, the Narada sting operation video was released in which Hakim was seen allegedly taking bribes. On 19 September 2017, he was questioned for eight hours by the Central Bureau of Investigation at Nizam Palace about the sting operation. Hakim said that the CBI probe was a "political conspiracy" against his party and that "he was not seen taking cash in any of the footage". Before the 2016 West Bengal Legislative Assembly election, Hakim, while speaking to Maleeha Hamid Sidiqqui of Pakistani newspaper Dawn, referred to his constituency as "mini-Pakistan". However, he denied making such a statement. He said "she only asked me that this place looks like Karachi of Pakistan. I did not make any comment". He also said that he was "being targeted for being a Muslim and that it was a communal conspiracy".