The 27-year-old, who arrived at Loftus Road from Real Madrid two years ago, has returned to Basque Country following a loan spell with the Liga side last season.
The Spaniard moved to Loftus Road from Real Madrid in 2012 but suffered relegation from the Premier League in his first season with the London club.
Granero was then loaned to Sociedad last summer but featured only seven times during an injury-hit 2013-14 campaign in which he tore the anterior cruciate ligament in his right knee.
However, the 27-year-old, who secured a league winners' medal at the Santiago Bernabeu in his three-year spell with Madrid, will now return to Liga on a permanent basis with Sociedad.
Granero made a total of 28 appearances for QPR in all competitions, scoring one goal.