Nitrogen and oxygen at 20 °C are within about 1 percent of ideal below 10 atm (Z = 0.993 for nitrogen at 10 atm), but carbon dioxide, nearer its critical temperature, is 4.5 percent low there (Z = 0.955).
The ideal law ignores the size of the molecules, which pushes the pressure up, and the pull between them, which pulls it down. At modest pressure and room temperature the pull wins a little for most gases and Z is just below 1; at high pressure the size wins and Z rises above 1 (helium, which has almost no pull, is 1.19 at 200 atm).
These are van der Waals figures, good to a few percent away from the critical point and wrong near it; for design use the measured data or a proper equation of state (the NIST tables). The law also says nothing about a gas that liquefies: carbon dioxide at 20 °C turns to liquid at about 57 bar.
Estimate with the rule, then check it against the calculator that models it properly.
Open Ideal Gas →