There are many ways a person can be legal in the United States. A person may be a citizen by birth or through their parents and sometimes grandparents, or they may become citizens by naturalization. Naturalization usually requires having a green card for five years, but the requirement is only three if you are serving in the armed forces or are married to a U.S. citizen.
Green cards allow a person to do almost anything a citizen can except vote.
Permanent residence is generally valid indefinitely, but a green card can be cancelled if the holder is deported or excluded, or abandons it by moving their primary home abroad. Nonimmigrant or temporary visas are issued for limited times and purposes. There are temporary visas or status for most legitimate purposes, although they may be difficult to get in many cases. Many temporary visas may require some proof that you intend to stay in the US only temporarily. Religious Workers Visas may be waived for citizens of certain countries or in some unusual situations, but it is usually much better if you can get a visa.