The Germany international announced in January that he would not be renewing his deal with Gladbach and has long been tipped to replace Victor Valdes, who is set to leave Barca after spending his entire senior career at Camp Nou.
Ter Stegen's prospective move to Catalonia was thrown into doubt when Barca were handed a two-window transfer ban in April for breaching rules over the signing of international players under the age of 18.
However, that suspension has since been put on hold, allowing Barca to make moves in the transfer market.
Ter Stegen, 22, has duly been confirmed as Barca's first addition of the close-season, with the deal announced on the same day that the 22-time Spanish champions confirmed Luis Enrique as their new coach.
The club have also revealed that Jose Manuel Pinto, who served as first-choice keeper following a season-ending knee injury to Valdes in March, will not have his contract renewed, while Rafinha and Gerard Deulofeu have returned from respective loan spells with Celta Vigo and Everton.
Pinto spent six years with Barca and a statement read: "The board of directors wants to publicly thank the professionalism and dedication of Jose Manuel Pinto during these years at the club."
Attacking midfielder Rafinha, the younger brother of former Barcelona playmaker Thiago Alcantara, impressed at Celta under Luis Enrique this season, making 32 La Liga appearances.
Deulofeu, meanwhile, emerged as a potent threat during his loan stint at Everton, for whom he featured in 25 Premier League games.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1