The 30-year-old Bayern Munich defender, who made his international debut 10 years ago, led his country to World Cup glory against Argentina in Rio de Janeiro last week in what was his 113th international appearance.
Lahm took over as captain for the 2010 World Cup in South Africa, when Michael Ballack was injured, and played every minute of all seven games that Germany played on the way to glory in Brazil.
"I told Jogi Low about my decision to retire from international football on Monday," Lahm told Sport Bild.
"I'd been thinking about it over the course of last season. I am delighted that things all came together with this World Cup win.
"I gave DFB president Wolfgang Niersbach a call and thanked him and everybody else at the DFB for the last few years."
He will continue to play for Bayern, having captained them to a historic treble of the Bundesliga, German Cup and Champions League in 2013, and he signed a new contract at the Allianz Arena this summer.
"There is hardly a better farewell than to be a world champion at the peak of your career," Bayern chairman Karl-Heinz Rummenigge said.
"But for the national team, it will not be easy to replace Lahm as a player, captain and a man."
Lukas Podolski, who played with Lahm in Munich before moving to Arsenal, was one of the first to pay tribute to his former team-mate.
He said: "Ten years in the national team, three years for Bayern; Philipp, it was a pleasure to play in one team with you."