The answer to this question depends entirely upon the agreement you have with your landlord. If your lease starts on the first of the month, you have until the last day of the month before.
If the lease is not a term lease (e. g. six months or twelve months), then to move, you are simply obligated to give a 30 day notice and at the end of the thirty days, provided that all of the due and necessary rent is paid, you move and surrender the keys.
Typically the month to month lease usually runs for thirty consecutive day depending on the day you moved in. However in most states after the thirty days have expired the leasor can't start eviction proceedings for three days. Also they have to go to the courthouse and file against you that will give you a little more time.
In general, a month-to-month lease can be terminated with thirty days notice. That means that a month-to-month renter has to move out within thirty days of being notified to leave.