

See molecules are simply formed by combination of atoms.
If atoms of same element combine then a molecule of element is formed e.g., O2, N2, Cl2
If atoms of different elements combine then a molecule of compound is formed e.g., H2O, NH3
In case of compounds, molecules are strictly made up of atoms of different elements.
I hope the difference is clear to you.
