Look at the formula of the compound containing oxygen. In some cases it's obvious, e.g. a mole of $\ce{O2}$ in the air. In other cases, you'd need to know how oxygen is liberated. For example, one mole of hydrogen peroxide, $\ce{H2O2}$, liberates only one half mole of gaseous oxygen: $\ce{H2O2 -> H2O + 1/2 O2}$ or better, $\ce{2H2O2 -> 2H2O + O2}$.
Er, umm... why write this as $\ce{1/2 O2}$, rather than one $\ce{O}$? BecauseThe answer is because though the oxygen might be liberated in a very reactive atomic, rather thenthan molecular, form, as in "piranha solution", it rapidly links together as molecular $\ce{O2}$.
Yes, it can be confusing, since there are a number oxygen allotropes. Aside from $\ce{O2}$, or dioxygen, which makes up about 1/5 of the air, there'sthere is $\ce{O3}$, ozone, and solid oxygen may contain $\ce{O8}$. And, as Herr Lehrer states, "There may be many others, but they haven't been discavard".