In order to end month to month agreement (also called periodic agreement) you will have to prepare a notice and then give it to the landlord. You will have to make sure that you give the notice of the same number of days as it is between the rent and the payment. This is very important to understand. For example, if you are paying the installments monthly then you should certainly make sure that you give the notice of at least 30 days.
If you are in the habit of paying the rent every month then you should make sure that you give the landlord the notice of at least seven days. This is certainly a must. However it all depends upon the rental agreement. It must have been mentioned out there that how much time you will have to provide the landlord to think.
If you want to avoid disagreement then with the date of the notice you should also mention the date on which you are going to move. You should also make sure that you have a copy of the notice with you.
Now suppose you are living in some apartment and the landlord is in possession of the big building. Then it is quite sure that your landlord is not going to remember you. Hence you require providing the reference as well to the landlord. Only then he will accept your application.
You can issue the notice at anytime during the rental period. But you know to tell them about it when you are signing the tenant form. You should definitely make sure that you have mentioned in the rental agreement about this fact. However you will not mention it then as well it will work for you as this is the law made by the government for all the tenants.
Suppose you pay the rent on the first of every month. You can give the notice at any time to the landlord. You should know one thing that you will have to pay for the first 10 days of the month when you are leaving. You might not be living for so many days but you will have to pay for at least 10 days.
Suppose the landlord pretends that he did not have your notice. In that case if you will be able to prove that you have sent the notice then the court will assume that the landlord has received the notice and react accordingly.