There are several ways to obtain American citizenship including being born in the United States and deriving citizenship from your parents. Most immigrants, however, must go through a process called naturalization. After being a lawful permanent resident for five years (or three years in the case of an immigrant who obtained their residency through an American spouse and continue to reside with that spouse) an immigrant can file for naturalization to become a citizen of the United States. He or she must pass a test relating to the history and government test, undergo a background check, and be a person of good moral character. If all these requirements are met, the immigrant is allowed to take an oath of allegiance to the United States and to become an American citizen.
A full guide to the naturalization process can be found on this page of the United States Citizen and Immigration website.