The smallest cohesive unit of matter is an atom. Some atoms, like those of gold, can exist independently of other atoms. But many atoms have electron structures that create attractions to other atoms.These attractions can create chemical bonds, which are created through either the sharing of electrons between two atoms, or the outright transfer of electrons from one atom to another.
When two or more atoms bond, we call the bonded unit a molecule. Some molecules consist of just one type of atom: Hydrogen, oxygen, chlorine and fluorine gases are all good examples of this.
If a molecule consists of two or more different elements, then we call that a compound. Molecules range from very simple diatomic units like sodium chloride (NaCl), which is common table salt, up to huge polymers that can include thousands of individual atoms chemically bonded into a single molecule.