Final answer:
Sodium has one valence electron and loses it during bonding, while chlorine has seven valence electrons and gains one from sodium to become stable, following the octet rule.
Step-by-step explanation:
Sodium (Na), a Group 1 element, has one valence electron, while chlorine (Cl), a Group 17 element, has seven valence electrons. During the reaction to form sodium chloride, each sodium atom loses one electron and becomes a sodium cation with a +1 charge. Conversely, each chlorine atom gains one electron to become a chloride anion with a -1 charge. This transfer of electrons follows the octet rule, where each atom aims to have a complete set of eight electrons in its outer shell, mimicking the stable electron configuration of noble gases.