The Norway youth striker spent three years at City’s academy and impressed during a trial at West Ham at the end of last season.
His contract runs until 2017 with the option of a further two years.
???I???m very pleased to have signed for West Ham United,” Samuelsen, 18, told the club website. “I???m just really looking forward to getting started next season.
“When I was on trial here at the end of last season, I was amazed at the individual planning for each player. They have a great plan for each player. The atmosphere there is very good.
“First of all I want to play well for the U21s and get goals and assists. Overall I want to help the team do well and maybe lift the league title.
“It would be great to make my first team debut here at the Boleyn Ground. I???ve seen the plans for the new Stadium and they look amazing, it???s a very exciting time to join West Ham.”
Academy boss Terry Westley said:??”Martin is a very interesting character. He can play as a No9 or No10. As a young prodigy at 14, Real Madrid, Chelsea and Manchester City were all trying to sign him.
“He???s gone through a real growth and development recently. We see the potential in this boy and we???re so pleased that we managed to persuade him to come. He had a number of Italian and German clubs interested in him yet he decided to join us.”