An oxygen molecule is actually diatomic, an oxygen atom has the count of 16 protons and 16 neutrons. So an oxygen molecule contains two nucleii bringing the proton count to 32 and the neutron to 32, so the as a molecule it has a molecular mass of 32. Oxygen atoms that are unbonded are elements that do have 16 protons and 16 neutrons giving it an atomic mass of 16.