The correct answer is
Querías estudiar
The first two options are not it because the verb in them is not that you wanted but rather that you had to study. The fourth option uses a form that designates a different time period of the action. The third option uses the correct form that shows our wishes or desires which is you wanted to study.