How can they tell how many Catholics there were from the census? It didn’t ask about religion. The 1790 census is incompletely preserved (some states’ returns are missing, probably as a result of the burning of Washington in 1814), and before 1850 only heads of households were listed.
The number, 25,000 (Catholics), is from John Carroll (bishop), 1785.
First federal census:
http://www.census.gov/prod/www/abs/decennial/1790.html
...or a little more or less from any one of many returns from a search.