Carles Puyol is to leave Barcelona at the end of the season, bringing the curtain down on a trophy-laden, 19-year career at Camp Nou.