The tense is correct (unless the person is still studying at school).
You can also say:
How many years did you go to school for?
or
For how long did you study at school?
11 de julio de 2017
0
2
¿No has encontrado las respuestas?
¡Escribe tus preguntas y deja que los hablantes nativos te ayuden!