According to media reports on Thursday, the 24-year-old cost the Premier League club around 4.5 million pounds ($7.51 million).
"This is a proud day to have signed for West Ham," Sakho told West Ham's TV channel. "I really love English football and I've dreamed to come and play for one of the big clubs."
Sakho was voted Ligue 2 player of the year last season after his 20 goals helped Metz clinch the title by 11 points.
He made his Senegal debut in a friendly against Burkina Faso in May.
The signing of Sakho will help West Ham cover for injured England forward Andy Carroll who will miss the start of the season with an ankle problem.
Sam Allardyce's men launch their league campaign with a London derby against Tottenham Hotspur at Upton Park on Saturday.