A rental lease is a legally binding contract that remains in effect after the transfer of the property’s ownership. The new landlord CANNOT change the terms of the lease until after it expires. Once that occurs, either party can choose not to renew, or the terms–including the rent amount–can be modified to suit the new owner.
If the property owner has already collected that month’s rent before the closing date, the seller owes the buyer a pro-rated share of the rent for the remaining days left in the month. That amount of money will appear on the closing statement as a credit to the buyer and a debit to the seller.