The Hammers are understood to have the option of retaining Hart permanently at the end of the season.
Sky Sports reports that City will pay West Ham £4.5m, which will be used to cover Hart's wages and a loan fee.
Hart, who spent last season on loan at Torino, is delighted to have completed the move.
"It's important for me to play football and to get the opportunity to come here and play is absolutely awesome," he told the club's website.
"To be playing in the Premier League for a big club like West Ham, I'm really looking forward to the season."
— West Ham United (@WestHamUtd) July 18, 2017