The 34-year-old winger, whose contract at French club Toulon expires in June, confirmed the news on Instagram.
"The inevitable moment has come knocking on my door and I've welcomed it in for a drink." he said.
Habana scored 67 tries in the 124 Test appearances he made for the Springboks and his last international appearance was in 2016 when he was also vice-captain.
The electric winger underwent knee surgery last year and has struggled to make an impact at Toulon this season.
"It's been more than a year of hoping, trying, pushing and willing to get back on the field for one last time, to taste the sweet victory or encounter that gut-wrenching despair," he said.
"To hear the roar of the crowd or grab the pill out of the air. To make that last bone crunching tackle or score that last game winning try. But it's unfortunately just not to be.
"I, like most, would have liked my career to have ended differently, but sometimes things don't turn out quite the way we hope for.
"So at the end of this season, it's time to say goodbye and thank you to the game I so dearly love."