When the check engine light comes on, the computer in your car sees a fault. If there is a fault the computer deems dangerous enough to cause damage to the engine or catalytic converter the computer takes over and may over ride the driver's input not allowing full throttle and may put the transmission and engine in "safe mode". If the problem goes away or is intermittent the computer in your car looks for and monitors the fault. When it doesn't see the fault occur under the same criteria it had seen the fault previously, it may then turn off the light and allow the vehicle operate normally. A code is probably still stored in the computer of your car (it may be stored as a pending code) and requires a scan tool to retrieve the stored code. The code will indicate where the problem is and what items to investigate. Most likely an ignition problem but tests need to be done first don't over look the basics first.