Oxygen is an element. All its atoms are oxygen atoms. However, they do not exist separately. Instead, they pair up to form oxygen molecules (O2). Hydrogen also has molecules with two atoms (H2). We show this in their chemical formulae.
Compounds are made from two or more atoms chemically joined together. For example, water is a compound of hydrogen and oxygen. Each water molecule contains two hydrogen atoms and one oxygen atom. We show this in its chemical formula, H2O.