He becomes the second defensive reinforcement to have agreed to join Bayern this summer, with international team-mate Benjamin Pavard also on his way to Bavaria from Stuttgart after a €35m (£31m/$40m) deal was agreed in January.
"Today is a very important day in my football career," Hernandez said in a statement released by his new club. "Bayern Munich is one of the best clubs in Europe and the world. I am proud to be able to fight for all titles for Bayern in the future.
"I would like to thank Atletico, the management, the coaches, my team-mates and the fans for a wonderful 12 years. Atletico will always be part of me. Now I'm happy that I'm taking the next step at Bayern."
Hernandez leaves Atletico having formed a key part of their defence under Diego Simeone in the Spanish capital.
Since making his debut for the Rojiblancos in 2014 he has made 110 appearances for the club, though he will play no further role for Simeone's side this season as he requires knee ligament surgery.
"In our sports medical examination, we found damage to the inner ligament of the right knee, which must be repaired surgically," Bayern club doctor Hans-Wilhelm Muller-Wohlfahrt revealed.
"In my experience, Lucas Hernandez will be available to FC Bayern for the start of the 2019-20 Bundesliga season."
Hernandez, who can also play at centre-back, has made 15 appearances for his country and played every match for Didier Deschamps' side as they lifted the World Cup for the second time in Russia last summer.
"I am very happy that in Lucas Hernandez we have been able to sign one of the best defensive players in the world and a world champion," said Bayern sporting director Hasan Salihamidzic.
"Lucas can be used both in central defence and on the left of defence. In addition, Lucas will continue our tradition of outstanding French players and strengthen our team."
Hernandez's arrival continues Bayern's rebuilding project after an indifferent campaign for the giants of German football.
A sluggish start to the season under new manager Niko Kovac saw them slip behind Borussia Dortmund in the Bundesliga title race, though Bayern have since made up a six-point gap since the winter break and top the table on goal difference with eight matches to play.
Those disappointments, combined with an ageing squad that is set to lose Arjen Robben and Franck Ribery this summer, means Hernandez is unlikely to be the last new addition to the Bayern squad ahead of next season.