Interesting random topic for discussion. Somewhat embarrassingly, I'm trying to rack my brains and can't uncover any memory of toilets at any of my schools. Clearly there must have been somewhere, but I've just mentally done a complete tour of my comprehensive school (the only one for which I can remember enough of the geography of it), and not turned up anything in my brain, except possibly in the changing rooms, which would've only been accessible in PE lessons.
I also don't remember people asking to go to the loo during lessons, so I'm sure it wasn't the done thing, and I suspect it wouldn't usually have been permitted. Mind you, quite a few lessons were in 'temporary' huts away from the main building where any toilets would have been, so if the weather was cold or wet, there would have been a strong incentive not to want to go anyway!
Since - at comprehensive - our lessons were usually only each about an hour long, and we almost always changed rooms between lessons, often with a few minutes queuing outside the room before each lesson, I'm sure it wouldn't have been too difficult for anyone who wanted to go quickly between lessons.