The International Cricket Council said Sarfraz breached its anti-racism code in a one-day international in Durban.
Sarfraz, 31, later apologised and claimed his words were "not directed towards anyone in particular".
The wicketkeeper will miss two one-day internationals and two Twenty20 matches, all against South Africa.
"Sarfraz has promptly admitted the offence, was regretful of his actions and has issued a public apology, so these factors were taken into account when determining an appropriate sanction," said the International Cricket Council's (ICC) chief executive David Richardson.
The world governing body opened an investigation after Sarfraz was caught on a stump microphone using the Urdu word "kaale", meaning "black".
Sarfraz will also have to go on an ICC education programme.
He was charged under a part of the section of the code relating to "conduct (whether through the use of language, gestures or otherwise) which is likely to offend, insult, humiliate, intimidate, threaten, disparage or vilify any reasonable person... on the basis of their race, religion, culture, colour, descent, national or ethnic origin".
In response, the Pakistan Cricket Board (PCB) said in a statement that it had "a zero-tolerance approach to racist comments and behaviour", but expressed its "utmost disappointment" with the decision to ban Sarfraz.
The PCB said it believed the matter had been settled amicably following the player's apology and said it would seek to reform the anti-racism code at future ICC forums.
Sarfraz's suspension started with Sunday's fourth ODI in Johannesburg and the player will return to Pakistan, with all-rounder Shoaib Malik stepping in as captain for the rest of the South Africa tour - even though Sarfraz would have been available for the final T20 match on 6 February.
Back-up keeper Mohammad Rizwan, who has taken the gloves in Johannesburg, will remain with the squad for the T20 leg of the tour.