If your application is denied, the notice you receive will explain the reasons for the decision as well as whether you have options to challenge it. Based on the kind of application and on the reason for a denial, you might be able to file a motion for reopening or reconsideration, appeal the decision, or submit a brand new application.
In quite a few cases, such as asylum denials issued by USCIS, your case may then be referred on to an immigration judge for some further legal proceedings. If your green card application is denied now, you may have the option to appeal now to the Administrative Appeals Office (AAO) or to the Board of Immigration Appeals (BIA).
Should you get a deportation order, it may be possible to argue your case before a judge. Few decisions are eligible for appeal, and that notice you receive shall specify your options and deadlines. If any appeal or motion is available, USCIS provides certain forms, plus instructions, for all filing.

