A lot of people have written to ask how much do they have before they get into trouble for not leaving the country after an immigration petition is denied. Let me say that while the requirements can vary by your current status and the immigration category you applied for, but first and foremost, read your denial letter carefully to understand your options. Since this is such an important matter, follow the advice of your attorney. In case you filed the petition on your own and did not use a lawyer, unless you really cannot afford to, get a good lawyer immediately and decide after a consultation. While you maybe tempted to find answers on the Internet (on websites like this one), my suggestion is not to follow the advice online at this time. While it is useful to do some initial research online but you DO NOT want to go by the experience of someone even in your exact same situation. Also, no one knows if the advice is outdated or written by a legal professional. In law, each case is unique and is best handled by professionals.
Still, generally speaking, if your petition is denied or somehow you are no longer doing what your visa allowed to do (e.g. if you came on a H visa but got fired or laid off, you really have no legal basis to be in the US even though your visa and I-94 has a date in the future; similarly if you came on a F visa and dropped out of school, you are also out of status). Generally speaking, it is expected that you will leave as soon as reasonably possible, which typically means several weeks or a few months at the most. Each day you are out of status, you are accumulating unlawful status and unless you never plan to come to the US again, you may get a ban for a few years (the USCIS will know from your airline departure records when you leave). In case your kids are in school and you wish to complete the school year or a family member is hospitalized or you have some other genuine reason to stay longer than a few weeks, it is best to apply to the USCIS using Form-539.