你家有几口人 counts people with 口, the measure word for mouths at a table, and that is exactly the image. The question is warm rather than nosy. Note 我是独生子 - only child - which for one generation of Chinese was simply the default, and which still carries the weight of the policy that produced it.