Club captain Lahm has committed himself to a new four-year contract with Muller, a reported target of Manchester United, signing a new five-year deal.
Both men, who are set to play key roles for Germany at the World Cup finals, came through the club's youth system and, with the exception of a two-year loan spell with Stuttgart in the case of Lahm, have spent their whole careers with Bayern.
"Both Philipp Lahm and Thomas Muller are very important elements of Bayern Munich," said the club's chairman Karl-Heinz Rummenigge.
"Both have remained faithful to this club right from the very start of their careers and they are also going to play an important role here in the future.
"We are very happy that both have decided to commit their long-term futures to Bayern Munich.
"Now I hope that Philipp Lahm and Thomas Muller have a successful World Cup and I keep my fingers crossed for them and the Germany national team on the way to the title."
Lahm says he will retire at the end of his new deal, adding: "It was the right time to discuss an extension.
"This is definitely my last contract and I will end my career at Bayern Munich. That was always my wish and I'm delighted it has happened."
Muller says Bayern convinced him to remain at the Allianz Arena.
"I'm delighted to have extended my contract until 2019 so close to the start of the World Cup," he said.
"The club convinced me that I'm in the right place and I have the feeling that I'm an important component in the club's plans.
"Bayern have been my club since 2000 and they will remain so for years to come."
Another player set to stay at Bayern is goalkeeper Tom Starke, who is currently understudy to first choice Manuel Neuer.
"I am enjoying it and I would be happy to remain at Bayern Munich," said the 33-year-old.