If your written lease agreement ended on a date certain that has passed (e.g., November 2008-2009), unless there was a renewal clause in the lease, no notice was required provided that you vacated the premises on or before November 30, 2009.
If your written lease agreement ended on a date certain that has not passed (e.g., April 2009-2010), unless there was a clause in the lease which granted the tenant the right to terminate, you could not do so at this time and would be responsible for the rent for the remaineder of the term of the lease. Of course, if there was such a clause, then the terms of that clause would govern the requirements for a Notice to Quit.
If you were living on a month-to-month lease (e.g., you were paying rent every month but did not have a written lease), then you must give notice prior to the commencement of the next term. For example, if you were there without a written lease and paid rent on the 1st day of every month, then you would have to serve a Notice to Quit prior to the commencement of that term to vacate at the end of the term. (e.g., Notice to Quit must be served on or before October 31, 2009 to vacate on or before November 30, 2009). Of course, you are still required to pay rent during the term after you serve the Notice to Quit.
You should have an attorney review your lease and discuss the details of your circumstances with them. A strongly worded letter from an attorney may be a cost-effective way to induce the return of your deposit provided that there is no other reason for it to be withheld.
Disclaimer: Please note that this answer does not constitute legal advice, and should not be relied on, since each state has different laws, each situation is fact specific, and it is impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue. This answer does not create an attorney-client relationship. You are strongly advised to contact an attorney to obtain legal advice before taking or refraining from taking any action with respect to the above.
Matthew J. Walters
Law Offices of Gerard A. Walters
20 Vesey Street
New York, New York 10007