The 31-year-old Starke, who had been at Hoffenheim since 2010, will be replacing 37-year-old Joerg Butt, who will retire after the Champions League final against Chelsea in Munich on Saturday.
"We are happy to get Tom Starke," said Bayern sports director Christian Nerlinger. "He is an experienced professional who oozes calmness and can perfectly fill the gap left by retiring Joerg Butt."
Starke, who was also part of the Bayer Leverkusen squad until 2006, playing second fiddle to starting keeper Butt at the time, said he was delighted to get a shot at winning titles again.
"I look forward to this big challenge. It is amazing to get another shot at big titles in my career and especially to play in the Champions League."
Bayern finished runners-up to Borussia Dortmund this season and will compete in the top European competition.