Carvalho completed a £6.7million move from Barclays Premier League champions Chelsea after passing a medical in the Spanish capital.
Chelsea's decision to sell Carvalho, 32, after six successful years at the club raised a few eyebrows given that he played a key role in the club's title win last year.
The Portuguese revealed that he already had an agreement in place to leave the club after he agreed to stay last summer when Mourinho made a bid for the defender when he was in charge of previous club Inter Milan.
He said: "Last year, when Inter wanted me, I said that last season would be my last in England. Chelsea agreed to that, and that's why the transfer has been so easy.
"I had told them that I wanted to leave and have a go at playing in another country when I was 30 and 31 but they didn't let me."
Carvalho said that the lure of playing under Mourinho for a third time in his career was an important factor in his decision to join the Spanish giants, although he did admit his relationship with the "Special One" has at times been rocky.
"Mourinho and I have won many titles together and I hope to continue that run with this club. He has won titles wherever he has been," he said.
"For the most part, I've had a good relationship with him.
"There have been one or two moments when it hasn't been. Now the relationship is good and I hope that it continues to be good.
"Jose is our manager and he has achieved success at every club he has worked at and I hope that continues. He loves to win and only wants to win.
"I have wanted to play here for a long time and finally, I'm here. Now I want to do everything I can to help Real Madrid achieve their objectives."