He scored 39 goals in 76 competitive games for the Bundesliga side and will bolster Slaven Bilic's attacking options, with the West Ham boss having already signed Joe Hart on a season-long loan along with the England goalkeeper's former Manchester City team-mate Pablo Zabaleta.
West Ham are said to be paying a fee in the region of £13 million for Hernandez's services.
A statement on West Ham's official website read: "West Ham United and Bayer Leverkusen have agreed terms for the transfer of Javier Hernandez to London Stadium.
"The former Manchester United and Real Madrid striker will fly to London in the coming days to finalise personal terms and undergo a medical with the Hammers."
West Ham are also reported to be on the brink of signing Stoke City forward Marco Arnautovic, with a £24m fee understood to have been agreed between the two Premier League sides.
Chicharito became Mexico's all-time leading goalscorer in May, recording his 47 international goal during a friendly against Croatia.
He recently represented El Tri at the Confederations Cup in Russia.