Dear student,
1) KO2 = It is a compound because it consists of two combined elements.
2) NaCl = It is a compound because it consists of two combined elements.
3) Cl2 = It is an element because it consists of the same type of atom.
4) H2 = It is an element because it consists of same type of atom.
Regards!