Perez becomes the eighth player to join West Ham ahead of the 2018-19 season, and he will compete with fellow new signing Andriy Yarmolenko for a place in Manuel Pellegrini's starting line-up.
The Spain worldwide was signed by the Emirates club from Deportivo La Coruna for £17m in the summer of 2016.
Perez moved to Arsenal from Spanish side Deportivo de La Coruna for a transfer fee of £17.1 million back in 2016, after the striker had scored 24 goals in 58 league games for the La Liga side.
"I'm very happy to be here at such an historic club", he told the club's official website.More news: Liverpool's Loris Karius thanks fans for warm reception in friendly
More news: Don Lemon fires back against 'nasty, hateful' Trump attack
More news: China ready with additional tariffs
Perez joined Arsenal from Deportivo La Coruna for £17m two years ago, but played only 11 times, hitting a Champions League hat-trick against Basel, before being loaned back to Deportivo last season.
Football.London states a deal bringing the 32-year-old Colombia global to the London Stadium will be a loan agreement and will fight with Declan Rice and Pedro Obiang for a spot in defensive midfield - so first-team football will not be a guarantee.
"I'm very motivated." Perez said. "I'm very excited and looking forward to achieving lots", said Sanchez, who appeared at his second World Cup with Colombia this summer. He scores goals, but can also create them and link well with the midfielders.
The Brazilian completed his medical on Friday and subsequently signed a four-year contract at London Stadium until 2022.