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. 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 across the way.) It is 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.