(Adds detail, background)
The 36-year-old former England international played more than 700 games for Chelsea and has been their most successful captain.
"John has given us more than two decades of dedicated and exceptional service," Chelsea said in a statement.
"In that time he has displayed the utmost pride at wearing the Chelsea shirt."
Terry made the third-highest number of appearances for Chelsea, captained them a record 578 times and scored 66 goals.
"After 22 years there is so much to say and so many people to thank at this great football club," Terry said.
"From coaches, team-mates and staff to the fans who have given me so much support down the years, I can’t thank you enough," he added.
"I will decide on my future in due course, but for now I am committed to helping the team achieve success this season."
Terry has made only four Premier League starts this season as Chelsea have moved to the top of the table, four points clear with six games remaining.
"I will, of course, always be a Blue and am desperate to end my final season as a Chelsea player with more silverware," Terry said.
"I've always been conscious that I depart at the right time, in the right way, and I feel that the end of this season is the right time for the club and I."
Terry, who made his Chelsea debut in 1998, won the 2012 Champions League, four Premier League titles, five FA Cups, three League Cups and the Europa League.
He played 78 times for England.
(Reporting by Ed Osmond; Editing by David Goodman)