It can be anything from the gas cap not being on properly, to an oil change, to any number problems. Taking it to a location that can have the code read (such as the dealer, mechanic or even some Auto Zones) may help resolve the mystery.
For starters, look up (on the internet) the code list for your vehicle. Make sure it, also, tells you how to make it come up (depending on the age of the vehicle, you may have to press that little reset button on the dash a certain way, or press the brake so many times in succession). Either the CEL (Check Engine Light) will blink a certain way or it'll actually say something on the dash. Doing this may save you some cash as most mechanics will charge you just to check the codes.
If this is too complicated, get help from a friend, or if it's under warranty, still, take it back to the dealer and say "Fix it!"
Lots of things can make it stay on. I'd suggest taking it to your local mechanic or if it has a warranty to the dealership.
You could need a tune up... when's the last time you got one?