Puyol, who has spent his entire career at Barcelona and made his first-team debut in 1999, made the announcement at a press conference on Tuesday afternoon.
Carles Puyol: "I want to announce that at the end of the season I will no longer be a Barcelona player.
"There are three months of the season left and I will not give up. I will help the team.
"After two recent surgeries, it has become harder for me to recover the level that I demand of myself and that I need to be at to play here.
"I don't know what I will do after June 30. But I'm sure that in the summer I will rest.
"I would like to have a press conference at the end of the season to say a proper goodbye after a total of 19 years at the club."
He has made 593 appearances for the Catalan giants and is the second most capped player in the club's history behind current team-mate Xavi.
During his time with the first team, Puyol has won numerous trophies, including six La Liga titles, three Champions League crowns, two Spanish Cups and two FIFA Club World Cups.