The 27-year-old scored twice in eight appearances for the Hammers after joining from Velez Sarsfield.
But he had fallen out of favour at Upton Park following his summer move.
QPR boss Harry Redknapp said: "We're really pleased to bring Mauro in. He's a good footballer, someone with great ability who can play as a number 10."
A move looked on the cards after Zarate was quoted in the press as saying his manager Sam Allardyce refused to play him because he was signed by Hammers co-chairman David Sullivan.
Allardyce responded to that claim by saying the player "wasn't good enough" for West Ham.
After joining QPR, Zarate said: "I need to play and Queens Park Rangers have given me this chance to show what I can do."
He could make his Hoops debut in the Premier League at Burnley on Saturday.
West Ham's Argentina striker Mauro Zarate has signed for Premier League rivals Queens Park Rangers on loan until the end of the season.