The 32-year-old England international was released by the relegated Hammers after his contract expired at the end of last season.
He follows former international defender Jonathan Woodgate to the club after the ex-Tottenham centre-back agreed a deal last month having been released by the Londoners.
"This is another fantastic deal for this football club when you consider the quality and experience of the lad," manager Tony Pulis told stokecityfc.com.
Pulis continued: "We now have strength in depth in our defence with both Matthew and Jonathan on board and we've managed to achieve that without significant outlay on transfer fees, which is quite remarkable in today's market of vastly-inflated prices.
"Their experience of performing at the highest level will be a valuable asset to us because we have some good young defenders and a young goalkeeper.
"Matthew was anxious to stay in the Premier League following his departure from West Ham and he sees this as the perfect opportunity for him to further his ambitions at both club and international levels in the future."
Upson will not only face competition from Woodgate for a place in the back four but also the established central defensive pairing of captain Ryan Shawcross and Robert Huth.
However, he is looking forward to the challenge.
"There is a lot of competition for places here and that is part of the attraction," he said. "I will relish the fight for a spot because it draws the best out of players. The manager has talked to me about the culture here, the discipline and the organisation, and that is an environment I am looking forward to working in."
Source: PA
Source: PA