It depends on the reason the landlord is asking you to leave. You will want to look at your lease.
Generally, if the landlord says you breached your lease, for example, by not paying your rent for multiple months, then the landlord likely does not have to give you notice before filing a case in court. On the other hand, if your lease is ending, and the landlord wants you to leave, it is likely that the landlord is required to give you notice. Read the next question for more information about leases that are ending.
If you live in public housing or housing where you get help to pay for your rent and you are being evicted, you will get a letter explaining why you are being evicted. You can also ask to talk to the Housing Authority about the eviction through an informal hearing before a court case might be filed. Learn more in our article on Eviction from Public Housing. Or watch this video.