There are dozens of different visas that allow you to enter the United States. Some visas are non-immigrant visas: they allow you to enter the United States temporarily for business or pleasure. Other visas are immigrant visas: they allow you to begin seeking permanent residence in the United States.
Visa expiry times vary widely. An ESTA, for example, lasts for 2 years. Some work visas last for 3 years. A temporary non-immigrant visa may only be valid for the specific period of your trip.