A member of the Gonja ethnic group in the Savanna region of Ghana, Mahama hails from Bole in the Savanna Region. Mahama was born in Damongo in the Damango-Daboya constituency of Northern region into a political tradition dating back to the country's First Republic. His father, Emmanuel Adama Mahama, a wealthy rice farmer and teacher, was the first Member of Parliament for the West Gonja constituency and the first Regional Commissioner of the Northern Region during the First Republic under Ghana's first president, Kwame Nkrumah. Mahama's father also served as a senior presidential advisor during Ghana's Third Republic under Hilla Limann who was overthrown in 1981 by Jerry Rawlings.
Mahama had his primary education at the Accra Newtown Experimental School (ANT1) before going to boarding school at Achimota Primary School. He completed secondary school at Ghana Secondary School (Tamale, Northern region). He proceeded to the University of Ghana, Legon, receiving a bachelor's degree in history in 1981 and a postgraduate diploma in communication studies in 1986. As a student, he was a member of Commonwealth Hall (Legon). He also studied at the Institute of Social Sciences in Moscow in the Soviet Union, specializing in social psychology; he obtained a postgraduate degree in 1988.