De Villiers was appointed in January following Hashim Amla's resignation, and led the team in 2 Test matches against England before injury forced him to miss the series against New Zealand and Australia at the beginning of the 2016-2017 season.
Commenting on his decision, De Villiers said: "The interests of the team must always outweigh the interests of any individual, including me. It was a fantastic honour for me to be asked to captain the Test side but I have missed two series and I am still in doubt for the upcoming series against Sri Lanka. Following the squad's outstanding performances in Australia, it is clearly in the greater interests of the team that Faf du Plessis should be confirmed as the permanent Test captain.
"I have known Faf for almost 20 years, ever since we played in the same school side at Afrikaans Hoer Seunskool, and he will have my unequivocal support if he is asked to continue leading this exciting Proteas Test team."
De Villiers has been ruled out of the three-Test series against Sri Lanka after failing to recover sufficiently from an elbow injury.
Proteas team manager, Dr Mohammed Moosajee explained: "AB's left elbow is much improved but is still regaining the last few degrees of straightening. Fitness to play requires full range of elbow movement and this may take another 3-4 weeks to achieve.
"He will be unavailable for the Test series against Sri Lanka and will target a return for the ODI series starting at the end of January."
Cricket South Africa Chief Executive, Haroon Lorgat, also expressed his admiration for the decision taken by De Villiers.
"AB has always carried himself as a true team player and his decision to step down confirms his attitude to put the team first," said Lorgat.
"It is no surprise that the CSA Board has confirmed Faf du Plessis as the Test captain to take over from AB," concluded Lorgat.