Since the molar volume of oxygen represents the volume occupied by 1 mole of oxygen at STP conditions, the ideal gas law equation can be written as
Now, STP conditions imply a pressure of 100 kPa and temperature of -273.15 K. Plug these values into the equation and you'll get
Notice that I've converted the pressure to atm in order to be able to use the value for
The molar volume of oxygen at STP is 22.71 L.
A very important thing to notice here is that, regardless of what ideal gas you use, the molar volume at STP will be identical across the board, since you'll be using 1 mole in the ideal gas law equation regardless of what gas you're dealing with.
That is why the volume occupied by 1 mole of any ideal gas will be equal to 22.7 L at STP.
SIDE NOTE You'll very often see the molar volume of a gas at STP being given as 22.4 L; this is the value that corresponds to the old IUPAC definition for what STP means.
STP is now defined as 100 kPa and 273.15 K, but it used to be 101.325 kPa, or 1 atm, and 273.15 K. If you use the old values for pressure and temperature you'll indeed get a molar volume of 22.4 L.
Depending on what your teacher or textbooks use, you can chose either the old definition of STP and 22.4 L, or the new definition and 22.7 L.