Ulreich is likely to take over the number two role at the German champions behind Manuel Neuer with former Liverpool goalkeeper Pepe Reina expected to depart the club during the close season.
Reina has been linked with Napoli and Real Madrid after being limited to only three league appearances last season.
Ulreich made 26 Bundesliga appearances for Stuttgart last season keeping five clean sheets.
According to Squawka, Ulreich averaged 2.43 saves per game in the league last season.
"I have searched for many years in Stuttgart for a new challenge," said Ulreich on the club's official website.
"Since I am here at Bayern, I'm in exactly the right place.
"I'm looking forward to the whole team and all the new things that will happen to me. I want to do my part to success and will always be there when I'm needed."
"We are very pleased that we were able to sign an experienced Bundesliga goalkeeper in Sven Ulreich," said Jan-Christian Dreesen, the deputy chairman of the club. .
"Sven Ulreich fits not only athletic, but also in character perfectly to Bayern. We are happy that he has chosen us,