He joined Juventus in 2017 and made 252 appearances across seven years in Turin, winning three Serie A titles and three Coppas Italia.
The Warsaw-born player won 84 caps for Poland, playing at four European Championships and two World Cups.
When he announced his retirement Szczesny said: “Today, though my body still feels ready for challenges, my heart is not there any more. I feel that right now it is time to give all of my attention to my family.”
Szczesny could make his debut against Alaves in La Liga on Sunday.
Barcelona suffered a 4-2 defeat by Osasuna on Saturday but remain top of the table with seven wins from eight games.
On Tuesday Hansi Flick’s side beat Young Boys 5-0 in the Champions League.