It is mandatory for pupils in Austria to complete nine years of school, four years in elementary school (Volksschule) and four years in a school for lower secondary education (Hauptschule) or grammar school (Gymnasium). Students who want to do an apprenticeship additionally need to go to a polytechnic institute (Polytechnische Schule) for a year. After finding an apprentice position they have to visit vocation school (Berufsschule) for three years, this can be done either in block release (5 days a week for about four months) or day release (once a week in the same stretch of time as a normal school). On the days you are at school you don't have to go to work. At the end of those three years they have to take an exam, the final apprenticeship examination (Lehrabschlussprüfung).
Pupils who want to get a degree have to complete four to five years at an institution of higher education (Höhere Schule) or a vocational school with higher education entrance qualification (Berufsbildende Höhere Schule). Most of these schools require an entrance exam or demand high marks on your last school certificate. The final exam for either one of those higher education institutions is the matriculation (Matura). After that you are free to go to university, though some of the branches may require additional exams (e.g. medicine).