It depends on the units for the rest of the problem, you want them to match.
If pressure is given in pascals and volume is given in m^3, use 8.31 J/mol*K, as a pascal (which is a N/m^2) and m^3 multiplied together give you Joules (Newton * m).
If the pressure is given in atmospheres and volume is given in liters, use .0821 L*atm/mol*K.
If you're given something crazy like pascals and liters or atmospheres and m^3, convert one to the other so you can use 8.31 or 0.0821. A cubic meter is 1000L, and an atmosphere is about 100kPa (101.325kPA precisely).