Compare school and the school:
 Ellie is ten years old. Every day she goes to school. She's at school now. School starts at 9 and finishes at 3. We say a child goes to school or is at school (as a student). We are not thinking of a specific school. We are thinking of school as a general idea - children learning in a classroom. |  Today Elli e's mother wants to speak to her daughter's teacher. So she has gone to the school to see her. She's at the school now. Ellie's mother is not a student. She is not 'at school', she doesn't 'go to school'. If she wants to see Ellie's teacher, she goes to the school (= Ellie's school, a specific building). |
We use prison (or jail), hospital, university, college and church in a similar way. We do not use the when we are thinking of the general idea of these places and what they are used for.
Compare:
Ken's brother is in prison for robbery. (He is a prisoner. We are not thinking of a specific prison.) | Ken went to the prison to visit his brother. (He went as a visitor, not as a prisoner.) |
Joe had an accident last week. He was taken to hospital. He's still in hospital now. (as a patient) | Jane has gone to the hospital to visit Joe. She's at the hospital now. (as a visitor, not as a patient) |
When I leave school, I plan to go to university / go to college. (as a student) | I went to the university to meet Professor Thomas. (as a visitor, not as a student) |
Sally's father goes to church every Sunday. (to take part in a religious service) | Some workmen went to the church to repair the roof. (not for a religious service) |
With most other places, you need the. For example, the station, the cinema, (see Units 72C and 73C).
We say
go to sea /
be at sea (without
the) when the meaning is 'go/be on a voyage':
- Keith works on ships. He's at sea most of the time.
- but I'd like to live near the sea.
- It can be dangerous to swim in the sea.