The 29-year-old Brazilian has regained something close to his best form after only 51 appearances during his first two seasons at the club.
"I can only say good things about Mourinho," Kaka told Real Madrid TV.
"He had everything to [put an end to my career], he could have thought, 'A player who has a lot of responsibility on his shoulders is not doing well, we will sell him and bring someone else in his place, he is not a player I signed'.
"It was never his problem, but my own. And in the end he always stayed by my side, helping me and telling me to be calm and patient."
Kaka moved to the Santiago Bernabeu from AC Milan in 2009 for a reported fee of €68.5m (£59.5m).