Mavropanos moves to the London Stadium for £18m after West Ham missed out on Manchester United's Harry Maguire.
The Hammers reached an agreement with Manchester United last week but Maguire was intent on staying put at Old Trafford to fight for his place.
Mavropanos spent four years on the books of Arsenal but only made eight appearances during his time at the Emirates Stadium.
After spending two seasons on loan at Stuttgart, he made a permanent move last summer and completes his time at the MHP Arena with 89 appearances and eight goals.
After his arrival was confirmed, Mavropanos told the club's website: 'I am really happy and excited to be here – and to be back in the Premier League with West Ham United.
'It’s an exciting time to be joining the club after last season’s Conference League win – and I am really looking forward to the next step in my career. I can promise the fans I will give everything for them and the shirt.'
West Ham boss David Moyes added: 'I’m pleased to welcome Konstantinos to West Ham United. We’ve been looking to add to our centre-half options this summer, so it’s good we’ve been able to bring in an international defender of his ability.
'We’re really looking forward to integrating him into the group.'
West Ham are unbeaten this season with four points from their opening two Premier League games.