The 32-year-old keeper has agreed a two-year deal and will join QPR on 1st July when his contract with West Ham expires.
“It was important we brought another quality keeper into the group,” QPR boss Mark Hughes told the club’s official website.
“Rob is obviously someone with vast experience at international and Premier League level and his pedigree speaks for itself.
“He’s got all the characteristics of a top keeper and he’ll be a huge addition for us who will stimulate the goalkeeping group, which can only be good for the squad as a whole.”
Green added: “I’m delighted to be here. I’m excited about the challenge ahead and hugely encouraged by the direction in which the owners and Mark Hughes are looking to take the club.
“It’s an exciting period for everybody connected to QPR and I can’t wait to get started.”