The 20-year-old full-back - currently on loan at Girona - has signed five-year contract with Stuttgart, who also announced the arrivals of Marc-Oliver Kempf and David Kopacz from Bundesliga rivals Freiburg and Borussia Dortmund respectively, as well as Dinamo Zagreb defender Borna Sosa, on Monday.
Maffeo made just three appearances for City between a trio of separate loan spells at Girona, who he helped achieve promotion to LaLiga in 2016-17 and top-flight safety this term.
Girona sporting director Quique Carcel thanked Maffeo for his part in a proud era for the club.
"Pablo Maffeo has been one of the integral pieces of the team in the last few seasons," said Carcel.
"We are very fortunate to have been able to count on him for the last three years and to have contributed to his growth as a player.
"I would like to thank him personally and in the name of the club for his effort, as well as wish him all the success in the future."