Ter Stegen is expected to join Barcelona this summer to replace Victor Valdes, while Gladbach will install Sommer as its first-choice man between the posts next season.
Monchengladbach sporting director Max Eberl confirmed that Ter Stegen will be leaving after the season, although he was careful not to reveal the destination of the Germany international.
"After Marc-Andre ter Stegen has informed us that he definitely wants to leave at the end of the season, we have reached an agreement with his new club on the transfer arrangements," Eberl told the club's official website.
"He will move abroad; that's all for now."
Sommer has served as the top goalkeeper at Basel since 2010, making 152 appearances for the club and winning three successive Swiss Super League titles.
The 25-year-old is also expected to be part of Switzerland's World Cup team this summer having earned five caps on the international level.