The 37-year-old says he is not fit enough to deal with the demands of the modern game.
Zaheer took 311 wickets at an average of 32.94 in 92 Tests and 282 at 29.43 in 200 one-day internationals.
“As I was training for the upcoming season, it dawned on me that my shoulder may not last the rigours of bowling nearly 18 overs a day – that’s when I knew it was time,” he said.
He has made himself available for the Indian Premier League in April and May next year but plans to retire from all cricket after the Twenty20 competition is over.
Zaheer played his last Test in February 2014 against New Zealand in Wellington before a tendon injury in his left arm forced him out of the side.
He was part of India’s World Cup-winning squad in 2011, when his 21 wickets made him the tournament’s joint leading wicket-taker with Pakistan’s Shahid Afridi.