The 29-year-old has agreed a three-year deal and joins the London club for £16million.
"For me, the Premier League is the best league in the world and when the opportunity came, I was desperate to sign for this club," Hernandez told whufc.com.
"I’ve had three fantastic years playing in Spain and Germany, but England was really the first big chapter in my career and I am so happy to be back."
'Chicharito' enjoyed a successful spell with Manchester United which produced 37 goals and two PL titles in 103 matches.
He will hope to make his PL debut for the Hammers against his former club at Old Trafford on Sunday, 13 August.