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.

Staff were informed of the development on Friday by chief executive officer Thomas Mayer, a source told BBC Sport.
Administrators FRP said there was "a very limited window of opportunity" to save the team before the start of the 2017 season in Australia on 26 March.
FRP said it was "assessing options" and that the process affected Manor's operating company Just Racing Services.
Manor Grand Prix Racing, which owns the rights to the team's participation in F1, is not in administration.
Team owner Stephen Fitzpatrick said in a note to staff: "It was imperative that the team finish in 10th place or better in 2016."
Manor, who finished 11th and last in the championship last season, have been in talks with new investors but so far no deal has been concluded.
Administrator Geoff Rowley said: "The team has made significant progress since the start of 2015, but the position remains that operating a F1 team requires significant ongoing investment.
"The senior management team has worked tirelessly to bring new investment, but regrettably has been unable to do so within the time available.
"Therefore, they have been left with no alternative but to place [Manor Racing] into administration."
A source said several buyers had been lined up over the past few weeks and two had gone as far as conducting a due diligence process.
But none of them provided the funds necessary to buy the team, nor was there any proof they had the money to run it.
Fitzpatrick, the boss of the energy company Ovo, decided to put the team into administration on Thursday night.
FRP were also appointed the last time the team were in administration over the winter of 2014/15, after they collapsed with debts of £35m.
At the time, they were known as Marussia, and were reconstituted under their original name of Manor when Fitzpatrick bought them at the 11th hour just before the 2015 season.
Manor, who are based in Banbury in Oxfordshire, suffered a blow at the end of last season when Sauber moved ahead of them into 10th place in the constructors' championship thanks to the ninth place achieved by Felipe Nasr at the penultimate race of the year in Brazil.
"For much of the season we were on track," said Fitzpatrick.
"But the dramatic race in Brazil ended our hopes of [finishing 10th] and ultimately brought into doubt the team's ability to race in 2017.
"We made a huge amount of progress on and off track but ultimately it was not enough."
That cost Manor in the region of £10m in prize money - income they needed to survive into the new season - and the loss of it has made potential drivers and their backers reluctant to commit funds to the team, sources said.
Fitzpatrick said at the final race of the season in Abu Dhabi that the loss of income was "not a deal-breaker" in the talks he was having with new investors.
But there had been no further news from the team until Friday's development.
West Ham's Argentina striker Mauro Zarate has signed for Premier League rivals Queens Park Rangers on loan until the end of the season.
[NEXT_CONCEPT]
Manor Racing have gone into administration and will collapse without new investment.