depends on your lease contract.

there are some contract that states you have to pay the rest of the intended period, and there are some contracts that say you just have to give one month advance notice to the landlord and that's it you can move out.