“It's important for me to play football and to get the opportunity to come here and play is absolutely awesome,” the 30-year-old told whufc.com.
Hart has made 266 career Premier League appearances, winning two titles.
West Ham's pre-season began on Monday with a 0-0 draw against Sturm Graz II in Austria. Their next match is against Fulham on Thursday.
The Hammers start the new Premier League season at Manchester United on Sunday 13 August.
“To be playing in the Premier League for a big club like West Ham, I'm really looking forward to the season."https://t.co/6NAQUgKON1— West Ham United (@WestHamUtd) July 18, 2017
Watch: Joe Hart's best PL saves