he goes to school.-this sentence means that he is a student and goes to his school
he goes to the school-this sentence means that he just visits the school,not a student.

i wanna learn what can i do in the following sentences:
doctor mike goes to......... hospital
the guardian works in .......... prison.
Actually my doubt was a little different. I know that when a parent goes to his/her son's school for a meeting the article is necessary "He goes to the school". But what about teachers?
Do they fall into the same categories as students? A teacher goes to school (to work) or to THE school)
As for your questions, in American English you would say "Dr. Mike goes to the hospital",
and in the second example I'd say "The guardian works in the prison" "In prison" sounds like the guardian is a convict himself.
If someone said 'My teacher should go to school.', I wouldn't think
that it's his or her work time. As well as 'Dr. Mike went to hospital',
and 'The guardian went to prison.' I think that the article the would
be required in those cases.