The Pachuca star, 25, scored three goals for his country at the World Cup finals to catch the eye of the Premier League club.
On their official website, West Ham claim to have "fought off competition from a host of Europe's leading clubs" to sign the striker, who will link up with his new team-mates following the successful award of a work permit.
Valencia only joined Mexican club Pachuca in January 2014 and scored 18 goals in 23 appearances in the Torneo Clausura to help his side to second in the table.
Prior to his spell in Mexico he represented Emelec in his home country.
After scoring against England in a pre-World Cup friendly, Valencia went on to net in Ecuador's opening game against Switzerland and score twice against Honduras in a 2-1 win.
Valencia joins Mauro Zarate, Cheikhou Kouyate, Aaron Cresswell and Diego Poyet in moving to Upton Park this summer.
- Sports & Recreation