Dear Student,
Molecule of an element means molecule of same atoms. For eg. O2, N2,H2, etc whereas, molecule of compound means molecule of different atoms that are combining in a definite proportion to form compounds for eg. H2O, NaCl, CaSO4, etc.
Regards,