A minimum of 30 days written notice (send it in before the 30 day countdown begins). It is best to make sure they have received it so, mail it return receipt requested. The landlord has to sign off on receiving it. Don't play games on the last day. Be clear that you are out on a specific day like...the last day of the month.