In the case of the sodium ion (Na+), it has lost its only valence electron, leaving it with a net positive charge and an empty valence electron orbital. Therefore, the number of valence electrons in a sodium ion is zero.
On the other hand, the oxide ion (O2-) has gained two electrons compared to neutral oxygen. This gives it a total of eight valence electrons (six from the neutral oxygen atom plus two gained electrons), which are now distributed in its valence electron orbitals. Therefore, the number of valence electrons in an oxide ion is eight.
In summary, the sodium ion (Na+) has zero valence electrons, while the oxide ion (O2-) has eight valence electrons.