The 25-year-old has agreed a contract until June 2028 with the Europa Conference League winners.
He strengthens the Hammers’ midfield options following the sale of former captain Declan Rice to Arsenal.
West Ham manager David Moyes told the club website: “The midfield area was one we were especially keen to strengthen this summer – and Edson will complement the other options we have in that department.
“He’s an experienced international player, who has enjoyed great success for both club and country during his career to date.”
Alvarez won two Eredivisie titles during his four-season stay with Ajax.
He has been capped 69 times by his country, winning the CONCACAF Gold Cup in 2019 and 2023, in addition to playing at the World Cup in 2018 and 2022.
“It’s a hugely sentimental moment for me in my career,” he said. “To join a club like a West Ham is a dream for me and my family.
“The Premier League is a special league, the best league in the world, and I think my style will suit it.
“I now have a responsibility to West Ham and the West Ham family and I will give absolutely everything for the shirt.”
West Ham, who will play in the Europa League this term, begin the new season at Bournemouth on Saturday.
More from Sporting Life
Safer gambling
We are committed in our support of safer gambling. Recommended bets are advised to over-18s and we strongly encourage readers to wager only what they can afford to lose.
If you are concerned about your gambling, please call the National Gambling Helpline / GamCare on 0808 8020 133.
Further support and information can be found at begambleaware.org and gamblingtherapy.org.