The Germany goalkeeper's new deal runs until 2025 and contains a release clause of €500million.
Ter Stegen, who returned to action this month after a knee injury, has been one of Barca's few major transfer success stories in recent seasons.
The 28-year-old, who signed from Borussia Monchengladbach in 2014, has won 12 trophies with Barca including four LaLiga titles, four Copas del Rey and the 2014-2015 Champions League.
Ter Stegen has felt at home in the city since his arrival and is now keen for more silverware – and to celebrate in front of fans again.
"Barcelona has become a home for my family and I," he said in a video published by the club. "Both on and off the pitch, we are very happy.
"So, it was clear, the direction to take. The ambition from both myself and Barca has always been to reach a renewal agreement, to continue our story, which we started together in 2014.
"It's not just about playing for the biggest club in the world; it's more than that. The city and the fans have treated me like one of their own since the beginning, and this is important to me. A feeling I will never forget.
"I want to be a player at Camp Nou for many more years and keep winning trophies. There is no greater motivation. Hopefully, in the near future, with our fans once again."
Since his LaLiga debut, Ter Stegen has kept 64 clean sheets in 152 games, a tally bettered only by Atletico Madrid's Jan Oblak (110 clean sheets in 198 games).
He has maintained a save percentage of 74.4 per cent, which is the fourth-best in Spain's top flight among keepers to make at least 100 saves, and a passing accuracy of 83 per cent – the highest in the division for his position.