In general, asylum is granted to foreigners who prove there is a real fear of persecution if they return to their homeland. This concern is usually based on political differences, race, nationality and membership in a certain social group.
Asylum is available to those just getting to the U.S. or those who are already living there. For those just arriving, asylum may be requested at the border crossing, airport, seaport, etc.
If, on the other hand, you already live here, you must contact a qualified immigration attorney and have them fill out what is called an I-589, an Application for Asylum and for Withholding of Removal. You may do this within a year of your arrival. It does not matter if you are living in the U.S. legally or are not documented.
There are two ways to apply for asylum. The first way is to be able to prove you will be persecuted if you return home. In this instance, you file an application and start the asylum process. The other route you may take is to file for asylum if you are facing deportation proceedings.
Proving persecution is a difficult matter since most of the evidence required is still in your homeland. This is precisely why you need the services of an experienced immigration attorney who has handled hundreds of cases like this. S/he will greatly increase your chances of getting asylum.
The term asylum has a rather interesting history. Its origins are from the Middle Ages when the right of asylum or political asylum was protected by another royal power, a foreign country or a church. Many of us have seen movies about people seeking asylum in a church.
Despite some similarities between refugee law and political asylum, the two are not the same and should not be confused. Refugee law actually deals with a massive inbound refugee population and the right of asylum deals only with individuals seeking protection and is handled on a case-by-case basis.
Bilateral treaties between countries have thrown a bit of a wrench into the works and called into question the validity of asylum. Again, consulting an attorney who specializes in this area is crucial to making sure you have a fair hearing.