Smith broke the news to his team-mates after close of play on Monday, CSA said in a statement.
"This has been the most difficult decision I have ever had to make in my life," Smith said.
"It's a decision that I have been considering since my ankle surgery in April last year.
"I have a young family to consider, and I felt that retiring at Newlands would be the best way to end it because I have called this place home since I was 18 years old."
Smith made his first-class debut for South Africa at the age of 21, and ends his illustrious career with 17 228 International runs and as the most capped Test captain in the history of the game.
"I have always been someone who has left everything out there on the field for my team and for my country," he said.
"I'm extremely honoured and proud to have had the privilege to lead so many wonderful players and to have been a part of building the Proteas culture to what it is today.
"It is a culture that every player can be, and is, immensely proud of."
CSA reacted with surprise to Smith's decision, however, chief executive Haroon Lorgat was full of praise for the player's contribution to cricket in the country.
"Although Graeme's decision to retire from all forms of international cricket comes as a surprise to all of us, we must respect him for deciding to call time," Lorgat said.
"Knowing him as well as I do, having been instrumental as a selector in appointing him as a young captain, he would not have taken this decision lightly or without a great deal of thought.
"He has captained the Proteas for more than a decade and he will draw a lot more satisfaction from the fact that he leaves our Test team at the top of the world and in such good health rather than from all the personal records he has achieved."
The 33-year-old Smith has also led South Africa to the World Cup semi-final in 2007.
"I would like to express my deepest gratitude to the support from my parents and brother, my wife and children, my friends, my fans and to Cricket South Africa," he said.
"I thank and honour the players who I have played with and those who have supported me and helped me to be the person and captain I am today.
"I have been fortunate to have had many highs, amongst them leading and being part of the best Test team in the world. I will cherish these memories for the rest of my life."
Lorgat said Smith can proudly leave the game behind and deserved the gratitude of South Africans for leading the Proteas with distinction.
"I would like us to remember Graeme for his nerves of steel and his match-winning performances that were synonymous with some of the most remarkable fourth innings victory chases of all time," Lorgat said.
"These included setting up the 414 runs chase against Australia at Perth and his series-clinching innings at Edgbaston in 2008, not to mention the unbeaten century the last time he faced Australia at Sahara Park Newlands in 2011.
"His role in setting up the famous 438 win over Australia in 2006 was also a performance never to be forgotten."
Lorgat said as a member of the panel that appointed Smith as captain in 2003 ahead of his first assignment on the tour of England — he was privileged to see the player move on to the next stage of his career.
"He has been a mighty warrior, a leader of men and an exceptional part of our international cricket," Lorgat said.
"Following the recent retirement of Jacques Kallis from Test cricket, there is no doubt that we are now ready to move into a new era and it is our job to build on the solid foundations that these great players leave behind." – Sapa