The Oil light comes on when the oil pressure drops below a preset limit. this can occur if your oil pump is failing, you have low oil in the engine, you are using too thin of an oil or you oil viscosity is gone (Need an oil change) under extreme cases and depending on how you where driving the car, you created what is called dry sumpping, this occurs when the oil pump is pumping oil faster then the oil is returning to the pan. This causes the oil pressure to appear low and cause the light to come on. One last thought I have, depending on how many miles are on the engine, you may have worn out rings and bearings in the engine and it is time for a rebuild.