The 30-year-old striker, who has been given the No.2 shirt at the Allianz Arena, has signed a contract which runs until 2020.
A Munich native, the striker is a Bayern youth product and represented the club between 1995 and 2008 - making four first-team appearances - before leaving for Duisburg in search of regular first-team action.
"I’m thrilled!" said a delighted Wagner of his move. "A long journey has come to an end for me. I’m back home, back at my club in my hometown. I’m really happy that it’s all worked out. Bayern are the best team in Germany and one of the best in the world. I didn’t have to think long when the offer came in."
Wagner scored 15 Bundesliga goals in 42 games for Hoffenheim after joining in the summer of 2016, his top-flight efforts enough to earn him international honours. The burly striker has won seven Germany caps to date, scoring five goals in that time.
Watch: Wagner's top three Bundesliga goals
"A Germany international is joining FC Bayern in the form of Sandro Wagner," he said. "We’re convinced Sandro has the class and experience to improve the quality of our squad."