Ion Formation 
An ion is an atom with a charge. There are two kinds of charges, positive and negative and the electronic structures of the elements affect the kinds of ions that they form.

We will start with the simplest of all atoms, hydrogen. An atom of hydrogen has one proton in the nucleus and one electron in orbit.  Since protons are positive and electrons are negative then the charges on the proton and electron cancel out.  An atom of hydrogen is essentially neutral. If the hydrogen loses its electron (the reason why will be saved for later) then we are left with just a proton in the nucleus.  This is symbolized by H+.  This is now a hydrogen ion.  It has a charge and a much smaller radius.  In chemistry we write this like:

           H0  ---->   H+  +   e-          "neutral hydrogen --> a hydrogen ion and an electron"

This can also be written as:   H0 ----->  H+  + e-
                                          1s1             1s0

For a second example we will look at sodium, Na0.  A neutral sodium atom has 11 protons and 11 electrons.  It is neutral because the 11 positive protons exactly cancel out the 11 negative electrons.
If sodium loses an electron the sodium becomes an ion with a positive 1 charge.  This is because the 11 positive protons and 10 negative electrons end up with an overall charge of +1.
                                 11 protons + 10 electrons =  +1
                                        +11     +   (-10)         =  +1

This can be written as Na0 -----> Na+ + e-

Or like this    Na0  ------------>  Na+    +    e-
             1s2 2s2 2p6 3s1      1s2 2s2 2p6 3s0

It only takes a relatively small amount of energy to take an electron away from the neutral sodium atom. So it is very easy to create a Na+ ion.  To remove a second electron from Na+ an enormous amount of energy is required.  This energy is not normally available and so sodium stops losing electrons as soon as it reaches a noble gas configuration.

Other metals act the same as well. Calcium usually forms ions with +2 charges.  The amount of energy required to remove two electrons is small. The amount needed to remove a third electron is far to high, so calcium loses only two electrons and so achieves a noble gas electron configuration.

    Ca0    1s2 2s2 2p6 3s2 3p6 4s2
    Ca+2  1s2 2s2 2p6 3s2 3p6       The full "p" subshell indicates a noble gas configuration like Ar.

It also sums to the correct amount. Ca+2 has 20 protons and 18 electrons which add up to a net charge of +2.

In the case of the metals, it is the stability of the noble gas core that lies beneath the outer shell of electrons that effectively limits the number of electrons that they can lose.  The ions that form tend towards a noble gas configuration.  The positive ions are collectively termed "cations".

A similar fate occurs to the non-metals which form negative ions.  Negative ions are collectively termed "anions". Oxygen and chlorine are typical nonmetals that form anions when they react with metals such as calcium or sodium. When a chlorine atom reacts, it gains one electron. For a neutral chlorine atom we have

                      Cl0      1s2 2s2 2p6 3s2 3p5

In this neutral atom there are 17 protons in the nucleus and 17 electrons in orbit.  (+17 + (-17) = 0)  and when chlorine reacts it gains an electron  Cl0 + e- -----> Cl-    to become
                      Cl-1      1s2 2s2 2p6 3s2 3p6
The full "p" subshell means that the chlorine ion now has the same electronic configuration, is isoelectric, with Argon, a noble gas.
At this point, the gaining of electrons stops, because if another electron were to be added, it would have to enter an orbital in the next higher shell.

With oxygen, a similar situtation exists. The formation of the oxide ion, O2- gives oxygen a noble gas configuration isoelectric with Ne. The gaining of two electrons happens very easily.
        O0 (1s2 2s2 2p4)  +  2 e-   ---->  O2-  (1s2 2s2 2p6)
Generalization:  When a neutral atom form ions, atoms of most of the elements tend to gain or lose electrons until they have obtained a configuration that is the same as that of the nearest noble gas.
              Go to the Ion Worksheet