Generally, atoms are neutral because they have the same number of protons, or positively charged particles, as electrons, or negatively charged particles. However, many atoms are unstable, so they form ions -- atoms or molecules with a positive or negative charge -- by losing or gaining electrons. There are two types of ions: cations, which are positively charged because electrons are lost, and anions, which have a negative charge because electrons are gained.
Look at the periodic table to determine how many protons and electrons an atom has for it to be balanced. For example, a sodium atom has 11 protons and electrons because its atomic number is 11.
Subtract the number or electrons from the number of protons in an atom as a basic way of calculating the charge of the ion. For example, if a sodium atom loses one electron, subtract 10 from 11, which equals 1. A sodium ion has a +1 charge, which is notated as Na+.
Consider the number of electrons in the atom’s outer shell, known as valence electrons, to determine why sodium gives up one electron to form a cation. These are the electrons that are given up or added to in order to form ions or compounds.
Understand that for atoms to be stable, they must have eight valence electrons. When atoms go through chemical reactions or form bonds, they gain, lose or share electrons in order to have eight valence electrons. Sodium has two electrons in its first level and eight electrons in the second, which leaves a single electron in its outer layer. In order for sodium to have eight valence electrons, it loses the one in its outer layer, so the second layer, which has eight electrons, becomes the outer layer, and the atom is a positively charged ion.
Follow the general rule that metals lose their valence electrons to form cations, while nonmetals typically gain electrons to form anions. Phosphorus, for example, has five valence electrons. It gains three electrons in order to obtain eight valence electrons. Phosphorus’s atomic number is 15, so it has 15 protons, but the addition of electrons gives it 18 electrons. 15 + (-18) equals (-3), so the phosphorus ion has a -3 charge.
Calculate the charges of polyatomic ions, or molecules with positive or negative charges, by looking at their oxidation numbers. The hydroxide ion, for example, has a -1 charge. Oxygen generally has an oxidation number of -2, while hydrogen has +1. (-2)+ (+1) equals -1, so the charge of the hydroxide ion is negative.
TL;DR (Too Long; Didn't Read)
Noble gases are the only atoms that have stable configurations of their valence electrons; they all already have eight electrons in their outer shell. The exceptions to the eight-valence electron rule are hydrogen, boron, beryllium and lithium, which are stable with two valence electrons.