Mandzukic, who scored three goals for Croatia in the European championship, joined Wolfsburg from Dinamo Zagreb in 2010 but despite scoring 12 goals in the recently completed season fell out of favour with coach Felix Magath.
Magath last week recommended the striker to his old club, who have beaten Everton to the in-form hitman's signing.
"We are very happy to be getting a top Bundesliga striker with Mario Mandzukic, who showed his scoring abilities at the Euro," Bayern sports director Christian Nerlinger said.
Mandzukic is seen as another attacking option alongside Mario Gomez as Bayern plot how to wrestle the Bundesliga title off Borussia Dortmund, who have won the German league for the past two seasons.
He is the sixth new arrival at the Allianz this summer, the Bavarians having already recruited Basel prospect Xherdan Shaqiri, returning Peruvian Claudio Pizarro, Mitchell Weiser, Tom Starke and Dante.