口(kǒu) is normally only used to introduce the number of family numbers while 个(gè) can be used in much broader occasions. For example,
Wǒde jiālǐ yǒu sānkǒu rén
My family has three people
‘There are three people in my family.’
Jiàoshìlǐ yǒu sāngè rén
Classroom has three people
‘There are three people in the classroom.’
彭小川，李守纪，王红. 对外汉语教学语法释疑201例. 北京：商务印书馆，2004.