The 25-year-old winger failed to break into the first team during his two-year spell in London and returns to his homeland after making just 23 appearances
The 25-year-old signed for the London club in 2010 after impressing for Mexico at the 2010 World Cup in South Africa.
However, after failing to breaking into the first team during his first year with the Hammers, the midfielder was loaned out to Spanish side Zaragoza for the 2011-12 season.
Barrera made 20 league appearances for the Liga outfit under compatriot Javier Aguirre, as the Aragonese outfit narrowly avoided relegation.
The 49-times capped winger joins Argentine striker Mariano Pavone and Colombia international Luis Perea as recent acquisitions for Cruz Azul.
Barrera began his career with La Maquina's city rivals UNAM, where he scored 21 goals in 80 appearances.