Education and Training Act 2020, s 36(3)
On any given day, you have to be at school when it’s ‘open for instruction’ for at least four hours. Otherwise, you’ll be recorded as truant (away from school) on that day.
However, that doesn’t mean you can leave school after four hours. You still need to get the school’s permission to leave before regular class hours are over. If you leave early without permission at any time the school can discipline you.