Let the number of vertices $=n$
Given degree of each vertex $=3$
Then, total degree of simple graph $=3 n$
We know that,
sum of all degree of simple graph
$=2 \times$ number of edges in simple graph
$\Rightarrow 3 n=2 \times(24)$
$\Rightarrow n=2 \times 8$
$\Rightarrow n=16$