Ich gehe zur Schule. has two meanings
1. I go to the place where the school is.
2. I'm a pupil.
There are regional differences in the use of 'I'm pupil':
Ich gehe in die Schule.
Ich gehe zur Schule.
Ich gehe auf die Schule.
Ich gehe zur Schule. in the sense of 'being pupil' has a long-term meaning. Not for one or two hours, but a longer time (months, years)