The atoms of the various elements differ in their affinity for electrons.
This image distorts the conventional periodic table of the elements so that the greater the electronegativity of an atom, the higher its position in the table.

Although fluorine (F) is the most electronegative element, it is the electronegativity of runner-up oxygen (O) that is exploited by life.
Example 1: Sodium (Na) and Chlorine (Cl) = Ionic Bond
- There is a large difference in electronegativity, so
- the chlorine atom takes an electron from the sodium atom
- converting the atoms into ions (Na+) and (Cl−).
- These are held together by their opposite electrical charge forming ionic bonds.
- Each sodium ion is held by 6 chloride ions while each chloride ion is, in turn, held by 6 sodium ions.
- Result: a crystal lattice (not molecules) of common table salt (NaCl).

Example 2: Carbon (C) and Hydrogen (H) = Covalent Bond
- There is only a small difference in electronegativity, so
- the two atoms share the electrons.
- Result: a covalent bond (depicted as C:H or C-H).
- The atoms are held together by their mutual affinity for their shared electrons.
- An array of atoms held together by covalent bonds forms a true molecule.
Example 3: Hydrogen (H) and Oxygen (O) = Polar Covalent Bond
- Here there is a moderate difference in electronegativity, causing
- the oxygen atom to pull the electron of the hydrogen atom closer to itself.
- Result: a polar covalent bond.
- Oxygen does this with 2 hydrogen atoms to form a molecule of water.
- are themselves polar; that is, have partial electrical charges across the molecule;
- may be attracted to each other (as occurs with water molecules) [Link to schematic];
- are good solvents for polar and/or hydrophilic compounds. [Link to a schematic of how water molecules dissolve a crystal of table salt (NaCl)];
Read more....
More info...
About (dot)
Chem guide
Hyper Physics