As a foreign national living in the U.S. after entering illegally, your marriage to a U.S. citizen may not, unfortunately, create a straightforward path to a U.S. green card (lawful permanent residence). U.S. immigration law has created various penalties for people who both enter and stay in the U.S. without permission.
We'll explain the problems here. The penalties you might face partly depend on how many times you crossed the U.S. border without permission or inspection.
You should definitely see an attorney about your hope to immigrate based on marriage to a U.S. citizen if you have entered the U.S. without inspection two or more times and
• your total amount of unlawful time in the U.S. totals one year or more; or
• you were removed (deported) from the U.S. and then came back illegally.
Such would-be immigrants may be permanently "inadmissible" to the United States. It doesn't matter that they are married to a U.S. citizen. The only thing they can do is to wait ten years since they last left the U.S. and then hope the government will allow them to apply to come back. See The Permanent Bar to Immigration for Certain Repeat Violators.
If you have entered the U.S. without inspection only once, or your previous illegal entries and stays total less than one year, here are your choices.
As the spouse of a U.S. citizen, you are known as an "immediate relative." This is true whether you are in an opposite-sex or a same-sex marriage, provided your marriage is legally valid in the place where it happened.
A green card is theoretically available as soon as you can get through the application procedures. Unfortunately, unless you fall into a rare exception (discussed in When Adjustment of Status Is Possible for the Immigrant Spouse of a U.S. Citizen), you will not be allowed to apply for your green card at a USCIS office in the United States. But if you leave after living here illegally for more than six months, you risk having the consulate punish you by refusing to let you return to the U.S. for three or ten years, as discussed in Consequences of Unlawful Presence in the U.S.—Three– and Ten-Year Time Bars.
To avoid being punished by the time bars, you need to act carefully and quickly. You have three options to consider:
• See whether you fit into the exception and can apply to adjust your status to green card holder in the United States. The exception is discussed in When Adjustment of Status Is Possible for the Immigrant Spouse of a U.S. Citizen.
• Leave the U.S. before you have been here unlawfully for six months and apply to an overseas U.S. consulate to return immediately with an immigrant visa. Your unlawful time is short enough that you should not have a problem in being granted the visa. The visa processing may mean many months of separation from your spouse while you wait overseas, but months of separation now might be better than three or ten years of separation later.
Make sure you can prove that your unlawful stay lasted less than six months. When the time comes to apply for your immigrant visa, the consulate will want to see proof of how long you stayed unlawfully in the United States. Collect and keep all evidence, such as your plane tickets, store receipts, medical records, credit card statements, and anything else relevant to show your dates of stay and departure.
• If you have been in the U.S. unlawfully for more than six months (and therefore face a minimum three-year time bar on returning), apply for a waiver that will forgive your illegal stay. Under USCIS rules, you can apply for this waiver before you leave the United States. Unfortunately, only certain people can gain approval of such waivers. You will need to show that, if your visa were denied, it would cause extreme hardship to your U.S. spouse or parents (if they happen to be U.S. citizens or permanent residents). When the law says extreme, it means far more than the sadness your spouse and/or parents will feel at your being thousands of miles away. The classic case of extreme hardship is someone whose U.S. citizen spouse has severe medical problems that require constant attention from the other spouse and renders him or her unable to leave the U.S. with you. See Proving "Extreme Hardship" to a U.S. Relative for Immigration Purposes. Once the waiver is approved, you can go to a U.S. consulate in your home country and apply for an immigrant visa with which to return. As soon as you enter the U.S. on that immigrant visa, you become a lawful permanent resident (green card holder). For more information, see Nolo's article Who Is Eligible for Provisional Waiver of the Three- and Ten-Year Time Bar.
For questions on any of this, and help with the challenging task of preparing a waiver application, consult an experienced immigration attorney.