It depends to some degree on the compressor and usage, rotary compressors generally run best with a low foaming oil and synthetics will give longer life.
Small shop compressors that don't get worked too hard, just about any SAE 30 oil will do. Most auto oils are fairly high in detergent, but not really required in air compressors, although it won't hurt them.
Multi stage high pressure compressors are more demanding in that they can be prone to carbonising the oil particularly around the interstage valves. I've also seen intercoolers choked with carbon, so an oil that resists carbonising is handy, think synthetic if this is your problem.
High ambient temperatures and high humidity make life hard for air compressors.
Small shop compressors change oil once a year, larger compressors, follow manufacturers recommended, use hour meter.