Tottenham Hotspur academy graduate Walker-Peters made more than 200 appearances for Southampton, with 33 of those in the Premier League last season when the south-coast team experienced the earliest relegation in the history of the competition.
The 28-year-old has also earned two caps for England, both received in 2022.
"It feels like it has taken a long time - I've been associated with a transfer to the club before - and I’m just pleased to finally be here.," Walker-Peters stated.
"I had a conversation with (coach) Graham Potter, and he played a significant role in my decision-making. I have always appreciated his coaching style, and I believe it will fit me well.."
West Ham, who ended last season in 14th position, will kick off their 2025-26 Premier League season on August 16 with an away match against Sunderland.