Many rental contracts have an early termination clause of some sorts. Generally, they charge you an “early termination fee” that’ll come out of your security deposit.
However, the laws also have “breach of contract” provisions: if your landlord is not keeping up the property (such as ignoring requested work orders), you have the right to leave at any time (before your term ends) and get your security deposit back. You may have to go to court over it, but you are offered that protection. It does go two ways though: if you are trashing the place, they can kick you out right away and keep your deposit.
For example, if you signed a 1 year lease, you are required to pay monthly for that entire year or face still penalties. But once you reach the end of your 1 year lease, your rental goes month-to-month. That implies that the rental rate stays the same (unless sufficient notice is given by the landlord, generally 30 or 60 days prior to the end of the 1 year lease). Furthermore, if you want to vacate, you have to provide a certain amount of notice (generally 30 days).
The key difference is whether rent control is in play there. In my Santa Monica apartment it was in play and the rent could only raise once per year and there was a maximum percentage increase allowable per year.
In Washington DC the vast majority of apartments are not under rent control. Consequently, the apartment legally has to default to month-to-month, but it doesn't have to stay the same rate. Generally what that means is that the landlord, 60 days before the end of the 1 year lease, will provide the tenant a new rate sheet with a monthly price is they want a 1-month lease, a different monthly price for a 6-month lease, and a different monthly price for another year lease. The 1-month lease price is generally MUCH MUCH higher than the new 1-year lease. That incentivizes the tenant to sign a longer term agreement and provide the landlord certainty of occupancy.
Another common model is an initial 1 year term that then converts to month-to-month.
Generally speaking, turnover higher than 1/year is incredibly costly for the landlord, so 1 year leases are the norm. Longer periods are too onerous on renters.
In commercial real-estate, though, longer periods are more common (5 and 10 years are not unheard of).
A bit off topic, but are US rental contracts for fixed periods? In Europe I'm used to a "valid until further notice" model, with possibility to break the lease with a given notice period (1-3 months) and a chance of yearly rent increases. Very much similar to employment contracts with notice periods and yearly raises.