The 26-year-old Mexico international has moved to the Bernabeu on an initial temporary basis, but Real have the option to make the deal permanent next summer.
The European champions announced the deal in a short statement on their website and Hernandez was presented to the media on Monday afternoon.
"To wear this jersey is a dream come true for any player in the world," he said. "One knows what this club represents. I am delighted to be here.
"It really motivates you when you know that a big club has wanted you. The only thing on my mind is to help this club.
"I am here to give my contribution in order for the club to continue to win titles. I want to thank Real Madrid for giving me this opportunity.
"I'm going to do my best mentally, physically, in order to help this team improve.
"Of course, I have aims, dreams and I'm going to go out on the pitch determined to enjoy this experience. I want to give my all.
"In my head and in my heart I am only grateful for being a part of this great team."
Hernandez shied away from comparisons with compatriot Hugo Sanchez, a Real Madrid star from the 1980s.
"Hugo had an extraordinary career here, but I have come to have mine," he said.
Hernandez's departure - after four seasons at Old Trafford - follows news of Manchester United's move for Colombia striker Radamel Falcao, who was linked with Real all summer.
The Mexican has scored 37 Premier League goals for United but has become increasingly marginalised since Sir Alex Ferguson's departure.
Hernandez started six league games last season and has played just 45 minutes of this season's competition under Louis van Gaal.