The Romanian international, 27, played 18 games for the Premier League champions last season but was allowed to leave the club on a free transfer.
Pantilimon is Sunderland's third signing this summer and will vie with Vito Mannone for the number one spot.
"It is a great privilege and honour to join a club like Sunderland," he said.
He joins Jordi Gomez and Billy Jones as manager Gus Poyet's free transfer acquisitions at the Premier League club.
Pantilimon added: "Sunderland have an amazing history and tradition and, of course, passionate fans.
"When I left Manchester City it was important that I chose a club with good ambition and a manager who has the hunger and desire to take the team forward.
"After speaking with the boss, I knew this was the right place and he was the right man. I can't wait to start."
Sunderland have signed former Manchester City goalkeeper Costel Pantilimon on a four-year contract.