The Selective Training and Service Act of 1940 was passed by Congress in September 1940, establishing the first peacetime conscription in United States history

The Selective Service Act of 1948 created the basis for the modern system. All men between the ages of 18 to 25 were eligible to be drafted for a service requirement of 21 months.

The Universal Military Training and Service Act of 1951 lowered the draft age from 19 to 1812 and increased active-duty service time from 21 to 24 months. Students attending a college or training program full-time could request an exemption.

The Military Selective Service Act of 1967 expanded the ages of conscription to the ages of 18 to 55. 

In 1967 conscription became based on random selection (lottery).

In 1973 the US creation of an all-volunteer armed force eliminated the draft.

In 1980, in response to the Soviet invasion of Afghanistan, Selective Service registration was retroactively re-established for all 18- to 26-year-old male citizens.

Under current law, all male U.S. citizens between 18 and 25 years of age are required to register within 30 days of their 18th birthday. 

Source: Wikipedia