The 36-year-old leaves the German national team as a World Cup winner after last month helping Joachim Loew's side to their first global crown since 1990 when they defeated Argentina 1-0 in the Rio-hosted final.
The Lazio frontman picked up his 16th goal, in what was his fourth World Cup, to surpass Brazilian Ronaldo as the tournament's leading scorer.
Klose, who won two German titles with Bayern Munich following spells with Kaiserslautern and Werder Bremen, said he had "fulfilled a childhood dream with the title in Brazil" and lived "unforgettable moments with the national team", according to a statement released by the German football federation.
"With the national team I achieved our greatest goal, a goal which we had together within the squad.
More From This Section
"In addition, I achieved personal goals and those who know me know that I am very ambitious, but I am a striker and the task of a striker is to score goals.
"Therefore the records never concerned me, but it was always about giving my best for the team."
The Polish-born marksman scored five goals at the 2002 World Cup, where Germany were beaten 2-0 by Ronaldo's Brazil in the final, five in 2006 on home soil, four in 2010 at South Africa and two in 2014.
He is one of just three players, alongside Pele and Uwe Seeler, to score in four World Cups, and finishes his Germany career as the country's all-time leading scorer with 71 goals in 137 appearances.