When do I use the molar mass of diatomic oxygen instead of atomic oxygen in stoichiometry problems?

To solve the problem below, I used #"1 mol O = 16 g O"# and got the right answer.

A white powder is analyzed and found to contain #43.64%# phosphorus and #56.36%# oxygen by mass. The compound has a molar mass of #"283.88 g/mol"#. What are the compound’s empirical and molecular formulas?

In what context would I use #"1 mol O"_2 = "32 g O"_2#?