There are different steps to be taken in order to obtain your green card. For people, who are already in the United States, the process is called Adjustment of Status, in which form I-485, Application for Adjustment of Status is filed with United States Citizenship and Immigration Services. Alternatively, for people who are outside of the United States, the process that they need to follow is called consular processing with the United States Department of State.
In addition to having an immigrant visa or petition approved, you also must meet all the requirements to be admitted as a lawful permanent resident. For example, the commission of certain crimes may make you inadmissible to the United States.
It is important to know, that once you have been granted your Green Card, you must maintain your permanent resident status. Leaving the United States for longer than one year may result in losing your green card. Also, commission of certain crimes may make you deportable from the United States.