The 29-year-old joined the English giants from Porto in October 2020, but struggled to hold down a regular place in the first team despite United's struggles last season.
Telles has mostly played back-up to Luke Shaw and was pushed further down the pecking order by the arrival of Tyrell Malacia from Feyenoord.
According to reports, the Spanish side will pay Telles wages in full but the deal does not include an option or obligation to sign the Brazil international.
Telles becomes the latest player to leave Old Trafford this summer as new manager Erik ten Hag overhauls his squad.
Paul Pogba, Edinson Cavani, Jesse Lingard, Nemanja Matic and Juan Mata all left for free after their contracts expired.
Andreas Pereira has joined Fulham on a permanent deal, while Dean Henderson has moved on loan to Nottingham Forest.