The check engine light comes on when the on-board computer detects a fault in engine driveability or performance, transmission control system or transmission, or the emissions system, and a fault code is set and stored in the computer. Faults that can set the check engine light can range from a vaccuum leak, engine mis-fire, low engine compression, faulty sensor such as O2 sensor or other engine sensor, hydraulic pressure loss in transmission, transmission shift solenoid, open/short in wiring harness, emission evaporative system leak, or one of over a hundred different reasons.
The only way to know what set a fault code and turned the check engine light on is to have a diagnostic scanner hooked up to the on-board computer and read it for stored diagnostic fault codes. Many auto parts stores will do this service for free- check with you local parts stores. If none in your area do, then you will have to take it to a shop and pay to have the computer read for stored fault codes.
Without knowing the fault codes numbers, it would be irresponsible to guess as to the cause as there are hundreds of possible causes