If you just bought a new apartment building, whether or not you may raise the rent depends.
The new owner takes all of the rights of the old owner – no more and no less. So take a look at the answer to the Question, “How often may I raise the rent?” Same answer. If the tenants have leases, you are stuck with them. If they have month-to-month rental agreements, you may raise the rent as much and as often as you likes so long as you give proper notice and don’t violate a local rent control law.
Before you buy a building, you should demand all leases and rental agreements from the seller and examine them to see how they might limit your ability to raise rents and to see what obligations you will have to your tenants. Also, be sure to find out what security deposits the seller holds. Depending on the law of your state, you might be responsible to the tenants for these – even if you don’t get them from the seller.
Buying a building and undertaking the duties of a landlord is complicated. You really should see a lawyer who specializes in real property to guide you through it and advise you of potential pitfalls. A small investment now might save you a lot of grief later on.