Many factors can affect the tendency of an oil to become rancid. The first is too much exposure to air. Since oxidative rancidity is the most likely kind of rancidity to affect your food oils, you always want to keep those oils in bottles that are tightly capped. (A tightly capped bottle will help prevent your oil from being unnecessarily exposed to oxygen.)
The next factors are heat and light. Since both of these factors can also speed up the rancidity process, protection from heat and light are also important when it comes to your food oils. With respect to light, your best bet is to purchase oils in bottles made from darker (tinted) glass (usually dark brown or dark green glass). You'll also want to store your oils in a cabinet that is lightproof. With respect to heat, many oils are best kept in the refrigerator where the temperature remains continuously low. (I will explain in a moment why I do not believe refrigeration is necessary for extra virgin olive oil, but why I still believe it is very important to store this oil in a cool spot.) Protecting your food oils from light and heat is a moment-by-moment process. For example, it means paying attention to the spot you place a bottle of oil when using it in a recipe. You never want to place it directly next to or above a stove that is turned on due to the increased risk of damage from heat. You also want to take the trouble of capping the bottle whenever you are not pouring oil from it.
The chemical composition of an oil is also a key factor in the risk of rancidity. Here the basic principles involve saturated and unsaturated fat. The more saturated fat contained in an oil, the less susceptible it is to rancidity. The greater the amount of unsaturated fat in an oil, the more likely it is to become rancidity. Since the healthiest plant oils are all highly unsaturated, they are especially susceptible to rancidity.
Some unsaturated oils, like extra virgin olive oil, are a little less susceptible to rancidity because a larger amount of their unsaturated fat falls into a special category called "monounsaturated." Extra virgin olive is about 75% monounsaturated, which is somewhat unusual for a plant oil. Plant oils usually have more polyunsaturated fat than monounsaturated fat, and that is one reason why they are particularly susceptible to rancidity. While the highly monounsaturated nature of extra virgin olive oil doesn't mean that you can forget about the issue of rancidity, it does mean that this unique oil is a little more stable than oils that have much fewer monounsaturates.
Both omega-3 and omega-6 fatty acids are always polyunsaturated. When it comes to plant oils, if you are trying to make sure that your diet contains an ample supply of omega-3s, you are always at the greatest risk for rancidity. Flaxseed oil, for example, contains about 15 grams of alpha-linolenic acid per ounce. Alpha-linolenic acid is a polyunsaturated omega-3 fatty acid not found in a wide variety of foods, and it's the basic building block for all other omega-3 fatty acids. Many food scientists look upon the alpha-linolenic acid found in flaxseeds oil as the most delicate part of its composition that needs to be protected from oxidative rancidity. In a case like flaxseed oil, where the chemical composition of the oil places it at great risk for rancidity, it's best to avoid any type of heating at temperatures above 150°F (66°C) and to store the oil in the refrigerator.