A molecule is a specific collection of atoms. Sometimes the atoms are the same, like in molecular hydrogen (H2) or oxygen (O2). Often more than one type of atom comes together to make a molecule, like in carbon dioxide(CO2) or water (H2O). Molecules have a specific size and chemical composition.
If a substance has a particular chemical composition, but no specific size, it's not a molecule. This includes table salt, a sodium iodide ionic solid, no definite number of sodium or iodide, just a specific ratio. Also, rocks and minerals have a chemical composition that tends to be close to SiO2, but not quite consistently enough to be called molecules.
For an in depth discussion of molecules, please see UC Davis's chem wiki.