In Soviet Russia, housing essentially owned you. You, along with some family, and maybe some strangers, were "assigned" to an apartment ("kommunalkas" were and are apartments shared by several families, with a communal kitchen, bathroom, hallway). As city populations (and individual families) grew, residents could be assigned to housing in newer block-like apartment buildings. Think of Cedar-Riverside in Minneapolis. Think of the literal meaning of Einstürzende Neubauten. Some Soviet neighborhoods were built thematically to create housing for workers at a specific factory near-by. Or, for example, the area serviced by the Akademicheskaya subway station was the neighborhood in which many academics were housed. This has had an effect on the social-class that lives in those neighborhoods now. Generations of prolies tend to produce, you guessed it, more prolies. Bask in the USSR, everything was state-owned.
Then, the state collapsed. In the 1990's, housing was privatized. Essentially, residents were given the ability to own the apartments or rooms in which they were living. Many people still live in those apartments to this day. Many younger adults don't move out until they move in with someone. Owners in apartments generally only pay utilities. When people buy an apartment, they can change their residency, or be "assigned" to that apartment. It is preferable to own rather than to rent. People who rent are either those who move out on their own, or move to the city. Where they rent is largely determined on budget--rent for an entire apartment could be the equivalent of a month's salary.
Simplified--the closer to the center of the city, the more expensive. Although, some wealthier Russians are choosing to live in single-family homes or town-houses outside of the city. A large number of modern and high-class apartments have been built in outer-laying neighborhoods. However, because housing in Russia is expensive to the utmost, there isn't as much freedom to move, or a culture of moving based on a specific cultural affiliation. There also really isn't a long-term lease. Consequently there isn't a cluster of businesses that cater to a specific demographic--there isn't a Chinatown or a hipster neighborhood. Some of the historically worker neighborhoods are classified as "hoods" and it is advised to avoid them at night.
You are assigned to social services (clinic, tax-office, housing authorities, tuburculosis dispensary) in the neighborhood of which you are a resident. Even "sleeper"/commuter neighborhoods have grocery stores, crap-electronics stores, clothing stores, pharmacies, eateries, etc. Most clubs, bars, stores, and entertainment locations are in the center of the city--which can be a drag if you live far or in an area separated by a bridge that gets drawn at night.
This, essentially, is the housing situation in St. Petersburg (and generally in most Russian urban areas).