Are you applying for a green card? If you do not qualify for an adjustment of status, then you would usually have to leave the country to apply through consular processing. If you are unlawfully present, however, leaving means that you cannot return to the country for three or ten years. People are unlawfully present in the U.S. if they overstayed their visa, never had a visa in the first place, or do not have a green card, etc. If you were unlawfully present for 180 straight days, you can be barred from returning the United States for three years. You could find yourself with a ten-year bar if you were unlawfully present in the U.S. for more than one continuous year.
There is, however, a waiver that may be able to protect you from these penalties. A waiver is the legal word for "forgiveness", in this instance, forgiveness of something that would otherwise disqualify your green card application. You absolutely cannot leave the country at all if you want to apply for this waiver. It may also be important to first note that you cannot be unlawfully present if you are currently younger than 18 years old. A permanent bar might apply in your case if you leave, however, so consult an immigration attorney before exiting the country.
The first criterion of eligibility is that you are the immediate relative of a U.S. citizen. An immediate relative is here classified as a spouse, parent, or minor child who is unmarried. A minor is younger than 21 years old. To apply for the waiver, you have to be inside the United States. Also, your unlawful presence has to be the only reason you are inadmissible for a visa or green card. This means no felonies on your record, no instances of fraud in your application, etc.
You also have to have been waiting to find out the date of your consular interview as of January 3, 2013. If you received a notice before January 3 about your interview, then you are not eligible for the waiver. The day your interview does not matter, only the timing of when the date was determined. If you qualify through all of the above, there is one more difficult thing to achieve before you can be eligible. You will have to establish that your immediate relative who is a U.S. citizen will undergo severe hardship if you have to leave the country.
Before you apply for the waiver though, your sponsor (relative U.S. citizen) has to petition for you to immigrate. This petition is USCIS Form I-130. He or she will also have to mark that you will be applying through consular processing overseas (which you do not yet want to do). Only once this petition gets approved can you apply for the waiver (USCIS Form I-601A). There will be a fee for this form. As you wait to hear about your waiver, you will have to contact the National Visa Center to let them know you are applying for this. Otherwise, they may schedule a consulate interview before you can leave the country.
As you can see, the qualifications for this waiver are stringent. It can be very hard to get your application accepted. As with every single issue in immigration law, this too is complicated. There are numerous restrictions and loopholes, and one misstep can ruin the whole process. It is in your best interests to work with an experienced and committed immigration lawyer. He or she may be able to successfully navigate you through the whole process.