In order to attain octet configuration, the atoms share, lose or gain electrons. In the process, its atomic mass:
does not change
The atomic mass does not change with chemical change. The loss or gain of electrons does not change the atomic mass because the mass of electrons is much lighter than nucleons. The mass of electrons is not considered for atomic mass. Atomic mass depends upon protons and neutrons.