The first national census in the UK was in 1801 and there has been one taken every ten years since that date [except for 1941 because of WWII].
I think the first ones didn’t show much but numbers of people, no personal details, except perhaps the name of the main householder. These were organised by the people who looked after the poor and also the clergy.
I believe that the census returns prior to 1841 were all destroyed, but, as with most things, there will be some that slipped the net. It may be possible to find the odd one but quite honestly I wouldn’t know where to look for those. However, I do know that the City of Westminster Archives have some information on anything they have before 1841, with lists of inhabitants. That could be useful if you were looking for London details.
A name index has been compiled for the years 1841-1901 and is available as a microfiche, for a fee from the National Archives and Ancestry, of course these lists are free to view if you visit personally.
From 1841 onwards these records are kept and the information is only released 100 years from the date of the census. The reason for this I suppose is because they expect most people appearing on the census will not be around any more.
I am not sure why the authorities do this, it cannot be privacy because you can go onto other sources for information and find records of people who are still living.
As the years have gone on more information has been added to the returns. Some of the older ones also mentioned whether the person was deaf, mute, or [quite unkindly I thought] an idiot/lunatic. All those from 1841 give each persons age, place of birth, occupation and relationship to the head of the house. Census returns are a very useful tool when you are doing family history research.
One of the ways I think a census return can be helpful is that the enumerator took the names of any person in the house on the night of the census, plus their relationship to the Head of the Household.
I myself have been able to confirm a connection in that way. I had the name of an Uncle of my Paternal Grandfather, but had never been able to prove the connection between the families, but from census details I found his Mother living with her Daughter and Son-in-Law and the name was the one I was looking for. So that proved to be very helpful and confirmed the connection for me very neatly.
Plus another time I found my Paternal Grandfather listed on his Royal Navy ship in Australia on the census night. Being a British ship the census was performed as though they were in England.
http://uk-genealogy.org.uk/census.html will give you links to all of the UK Census returns which are currently available online for England, Scotland, Wales, Channel Islands and the Isle of Man.
If you have access to census returns you can find so much information about a family, they really are a little mine of information.