The Federal Census was mandated by law in 1790 by the US Constitution that specifies that there shall be "an enumeration of inhabitants". In 1790, the U.S. population was about 3.2 million, not including slaves or untaxed native Americans. One of the main goals of the census was to provide information on men eligible for the military. We had only recently gained our independence from England and the men of the day knew it was important to assemble a viable military, if the need arose.
The federal census is taken every 10 years, in the year ending with zero. Individual states, however, often took their own Census in some of the years between the federal enumeration. These can be a valuable source, especially if you are looking for someone who died between censuses. The state census (taken mainly for the purpose of taxation) can also provide valuable data.