Well, we know they have living quarters because we've seen several of the teachers in their nightclothes. In Philosopher's Stone, Filch appears to take Harry, Ron, Hermione, and Neville to Professor McGonagall's living quarters:
Things couldn’t have been worse.
Filch took them down to Professor McGonagall’s study on the first floor, where they sat and waited without saying a word to each other.
Philosopher's Stone - page 177 - Bloomsbury - chapter 15, The Forbidden Forest
In Order of the Phoenix, in the chapter Eye of the Snake, after Harry has the experience of Nagini being inside him and attacking Mr. Weasley, Neville had to go and fetch Professor McGonagall from her quarters, although Harry was unsure of how long this took (he was traumatized). In Goblet of Fire, Snape appears in a nightshirt in the chapter The Egg and the Eye, and his quarters appear to be close to his office; he has a convo with Filch:
‘This egg was in your office, Professor?’
‘Of course not,’ Snape snapped, ‘I heard banging and wailing –’
‘Yes, Professor, that was the egg –’
‘– I was coming to investigate –’
‘– Peeves threw it, Professor –’
‘– and when I passed my office, I saw that the torches were lit and a cupboard door was ajar! Somebody has been searching it!’
Goblet of Fire - page 408 - Bloomsbury - chapter 25, The Egg and the Eye
Then Moody shows up in his nightshirt to complete the surly pajama party, but it's unclear whether he has quarters in his office, adjacent to it, or somewhere entirely different.
Even the most dedicated workaholic usually has outside living arrangements, even if they don't use them. The Hogwarts staff might be dedicated enough to spend the majority of their time in their offices, but I think they have quarters in Hogwarts aside from their offices. Teachers at boarding schools might be given on-premises living quarters that vary in size (not huge, typically), but could include a bedroom, a study, a living room, a kitchen, and a bathroom. At Hogwarts, an apartment-style residence would seem logical, as we know from canon that there are not teachers' homes dotting the landscape. We also know from J.K. Rowling that some of the teachers were married, but their spouses were not living with them at Hogwarts, which again points to small quarters.
As to Lupin curling up in his office to undergo his transformation and wait it out, a couple things occur to me. First, he was proud to have a job, much less a teaching position at Hogwarts. Perhaps completing the transformation in his office was more soothing for him. Perhaps it helped steel his resolve. Second, when I was at school, no one would ever dare to attempt to go into a teacher's locked office -- it was akin to breaking and entering! Of course that example is purely anecdotal, but it could be a factor. Besides, being a Hogwarts teacher just doesn't seem like a commuter position.
I believe Hagrid is the only Hogwarts teacher we know of who has his own home on premises, but he did start out as gamekeeper before his promotion. Please correct me if I'm wrong.