Sarr, 25, who began his career at Nice, joined Chelsea in 2020 but played just 21 games for the Londoners, including an appearance as an extra-time substitute in the 2021 Club World Cup final win against Palmeiras.
He spent much of his time at Chelsea on loan at Porto and Monaco.
Sarr made the permanent move to Lens after coming to the end of his contract at Stamford Bridge.
"Despite the trials and tribulations, he never gave up," said Lens general manager Pierre Dreossi in a statement, stressing Sarr's "European experience" and "his humility and team spirit".
Sarr is the club's third summer recruit after Ecuadorian defender Jhoanner Chavez and Burkina Faso goalkeeper Herve Koffi.
Lens, who finished seventh last season, begin their Ligue 1 campaign at Angers on August 18.