The check engine light comes on and stays on when a problem is detected by the self diagnosis system of your vehicle. Generally, the problem is in the emissions or something that is affecting the effectiveness of the emissions, but other causes can trigger the light to come on, too. To determine the cause, the vehicle will need to be taken to AutoZone or a shop that has an OBD2 scanner, or for 1995 and earlier models, an OBD1 scanner, While a scanner will not give you the magic answer, it will give you a code that narrows down the problem area.
A flashing check engine light is an indication of a severe misfire or problem that is likely to harm your engine. Immediate diagnosis and service is needed.
Some specific causes for the light to be on are:
Gas cap left off, not tightened, not installed correctly, or needs to be replaced.
Engine misfire - error might clear itself after 3 complete warm-up cycles; not restarts, but warm-ups.
At start up for a bulb check - Should not stay on.
Problem in the emission system, including clogged exhaust or the catalytic converter not functioning properly:
Dirty/clogged air filter.
Dirty MAF sensor.
There are pages and pages of items that can cause a check engine light to come on. Having it checked with a scan tool will narrow down the problem area.