The electronic configuration of
${ }_{64} Gd :[ Xe ] 4 f ^{7}\, 5 d ^{1}\, 6 s ^{2}$
So the electronic configuration of
${ }_{64} Gd ^{2+}:[ Xe ] 4 f ^{7} \,5 d ^{1} \,6 s ^{0}$
i.e. the number of $4 f$ electrons in the ground state electronic configuration of $Gd ^{2+}$ is $7$ .