In the United States, the government began taking a national census in 1790 and has been counting its citizens every 10 years since. These are an excellent source of genealogical information, and more years are available for searching online than ever before.
The original 1790 census only recorded the name of head of the household, as well as the numbers of males (older and younger than 16) and the number of females in the home. The number of slaves was also recorded for each household. Not all the original records from this first census have survived.
Over the years, questions have expanded to include names of all household members, specific ages, religion, places of birth, occupations, and marital status. Currently, the census is quite elaborate with a large number of detailed questions for each household.
In Canada, census taking first started in 1666 while the country was still a British colony. The first national census was in 1871. Enumeration also takes place every 10 years, but with a smaller questionnaire used every 5 years.
For either country, census records can be accessed in either print or microfilm form at many major libraries. Being able to view images the original documents (as opposed to transcribed records) can be particularly helpful, because errors can be made during transcription due to hard-to-read handwriting.
With the recent increase in interest in genealogy, many years of records are now available online, usually in transcribed form and with some images of the originals. Some online sources are searchable by family name, but some are only cataloged by county (or other geographical location).
Not all years are available, but there are many projects underway to get these records online. Since these transcription projects are all done by volunteers, there are still a large number of places/years that need to be added to online databases. You may want to check numerous sites to see what is available.
Here are some websites to visit, if you are looking for access to American and Canadian census records:
USGenWeb Census Project - Partial records are searchable, for several different census years.
Ancestry.com - a whole collection of federal and local census records, up to 1930. You will need to register (and pay) to use the site. Many other 'free' online sources actually just link back to Ancestry.com
Automated Genealogy - has 1901 and 1911 records for Canada, as well as 1906 (prairie provinces only)
ArchiviaNet - searchable database of 1901 and 1911 Canadian census records.