Of all the words attributed to the late Nelson Mandela, the ones that I didn't find in his discussions of such matters as his political views, his 27 year imprisonment and eventual release by South Africa's apartheid rulers, and his presidency of that country were references to a belief in or a guidance by a supernatural power. In the matter of the unjust and horrific incarceration such as what Mandela experienced, the tendency of many well known political leaders who have undergone similar hardship is to invoke prayer and faith in God as the source of their strength that got them through their ordeal. However, in a passage from Nelson Mandela: Prison Years Mandela instead said "...We drew strength and sustenance from the knowledge that were part of a greater humanity than our jailers could claim." Further, his outlook on life as reflected in 129 of his quotes are free of theistic allusions.
So was Nelson Mandela an atheist? Apparently, he was, even though he never declared himself outright as a non-believer. But even if it turns out that he was a theist, his lack of attribution to a supernatural being for his achievements was refreshing.
However, assuming for the sake of argument that Mandela was an atheist, did he come by this stance on his own or was it his membership in the African National Congress whose ally was the South African Communist Party that shaped his irreligionist views? In fact one source says that he was active and even held a leadership position in the latter organization.. But another source shades his affiliation with communism as tenuous and temporary. Mandela himself went so far as to acknowledge that the Communist Party did changed his views into accepting all races into the ANC and into realizing that African nationalism itself was not the exclusive property of any one ethnicity, However, as previously noted, he doesn't mention whether the Party, known for its atheism, influenced him in this matter as well.
But in the end, the measure of this man was not a label on his philosophy but the scope of his deeds and his personal fortitude as the contribution that he made to not just South Africa but to humankind.as a whole.