Chamakh arrived at Arsenal in 2010 on a free transfer from French club Bordeaux but found it hard to establish himself in the first team before slipping down the pecking order.
The 28-year-old Morocco international scored eight league goals in 40 appearances for the North London club.
"I'm very happy to be here, I want to play and give my best for this team," Chamakh said on the West Ham website (www.whufc.com). "I can bring my heading, some goals and we will see what else...
"I think this will be a very important move for me and I don't want to waste any more time. I want to contribute immediately. I didn't have opportunities to play recently, but I did well before and I know I am a very good striker. We played only one striker at Arsenal, so I didn't play a lot, so I hope to do so more with West Ham."
Chamakh has been capped 61 times by his country and won the French Ligue 1 title during his eight-year spell at Bordeaux.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)