A single oxygen has atomic number 8 that means the nuclei of all oxygen atoms have eight protons. The number of minus-charged electron is two but the number of electrons is 10. To gain a minus two-charge ion, it must have two more negative electrons than positive charged protons. With this, the ion has 10 electrons, which give it a -2 net charge.