The volume occupied by one mole of gas at stp is known as the standard molar volume of a gas. It has been found to be 22.41410 L. According to Avagadro's law, one mole of any gas will occupy the same volume as one mole of any other gas at the same temperature and pressure, despite mass difference. Knowing the volume of gas, you can use 1 mol/22.4L as a conversion factor to find the number of moles, and therefore the mass, of a given volume of a given gas at STP.
Behaviour of gases:
ㅤㅤㅤ ➝ PV = KT