The 19-year-old spent the end of the 2012-13 season on trial at Upton Park, and will now move to the club for an undisclosed fee after agreeing a two-year deal
The 19-year-old attacking midfielder has made 59 appearances for the Conference club, and will now make the step up to the Premier League following a successful trial at Upton Park.
The Manchester native has signed a two-year deal with the Hammers, and was suggested to manager Sam Allardyce by former Germany international Didi Hamann.
"He was recommended by Didi Hamann - who managed Stockport - as he felt he was an emerging talent that needed nurturing," Allardyce told the club's official website.
"I asked their current manager Ian Bogie about his talents and he allowed us to take a look at him last season and like every young player he's got talent."
The teenage midfielder is already targeting a role in the first team, having made his debut for Stockport at just 17.
"I'm very excited to have joined West Ham and I can't wait to get out there and play,” Whitehead said. "It's obviously a big step up, but I've got to take the opportunity and grasp it.
"I was on trial here at the end of last season and all the lads helped me fit in well during the two weeks of training i did.
"I've got a bit of experience from playing for the first team at Stockport - I'll probably be with the Under-21s here at the start, and then I'll be trying to push towards the first team."