"going back to school" means attending regular lessons at the school again.
"going back to the school" means returning to the school building for any purpose (e.g. you forgot something, you're delivering something, or whatever).
There are used in different situations, for example:
"David became disillusioned with college and dropped out for a year to work, but he's going back to school in the fall." (Everything is in general terms here, no specific college is named, hence no definite article is used.)
"David became disillusioned with Mountain View Technical University and dropped out for a year to work,