You may have experienced cabin fever of sorts during the last Snowpocalypse or hideous heatwave. But at least you've never been stuck in an apartment for months on end imprisoned in the body of a giant bug. You'd be literally climbing up the walls. (Thanks, Kafka! You always put things in perspective.)
The story doesn't give us a specific geographical location or historical date. With the exception of the very last paragraph (where the Samsas take a trip out to the country) all of the action takes place in the Samsas' apartment. We're going stir-crazy just thinking about this novella.
The apartment overlooks a busy city street, and a hospital is across the way within viewing distance from Gregor's window. (The story doesn't mention whether anyone can look in. Pity the poor convalescent who looks out his or her hospital window to see Gregor twitching.) It's ironic that the Samsas can be so centrally located without attracting more attention to the fact that there is an extraordinarily large bug living in their apartment.
The apartment itself is modest. Sandwiched between his parents' room and Grete's, Gregor's room opens out onto the living room. By confining all the action to the apartment, the story highlights Gregor's isolation from human society.