The school house provides citizens with education, which in turn increases how effective a citizen is at given tasks. For example, a woodcutter is able to get more logs from a single tree than a woodcutter that is uneducated. It can take a few years for children to finish school and end up as educated citizens. Overall, educated workers produce more food, gather materials and craft goods faster.
Schools are staffed by a teacher. If the school loses its teacher while students are being educated, the students will seek another school to go to; if no other school is available for them, they will become uneducated laborers instead. The school has a maximum capacity of 20 students.
Children normally become laborers at age 10, however if a school is present they will instead become students at that age. They will stay students until age 17 (or possibly later in some cases where the distance from the house of the student is quite far to the school), at which point they become educated workers.
No villagers will become students unless they are able to enroll at age 10, if a child becomes a laborer they will never be able to become educated. Additionally it is possible to stop work at schools in order to kick out all the students and have them become laborers, however it is then impossible to get these laborers to go back to school again.
It is recommended to build your first school house early on so that the children being born will grow up to be educated.