In an ionic compound a metal has transferred electrons to a non-metal, so the compound is made of oppositely charged ions. Strong electrostatic attraction holds the ions together. The ions are packed in a giant lattice, which is a regular repeating arrangement that goes on in all directions. Sodium chloride is an example. A pair of ions is not a molecule, because the lattice has no separate units.
In a simple molecule a small number of non-metal atoms are joined by covalent bonds, which form when atoms share pairs of electrons. Water and methane are simple molecules. Methane, CH4, has five atoms in each molecule. The covalent bonds between the atoms are strong, and the molecules are separate from one another.
A giant covalent structure also has atoms joined by covalent bonds, but there are huge numbers of atoms in one continuous network. There are no separate molecules. Diamond and silicon dioxide are giant covalent structures.