The only way to really tell is to have a mechanic run a diagnostics on the car.
Basically he will hook it up to a computer and scan the chip in your car, and an error message will pop up telling him what is wrong, and why the engine light is on.
Most times is the oxygen sensor, if the car starts, and runs good, most likely what it is.
However, the dealer should be taking a look at the car for free, and fixing whatever problem you are having as you JUST bought the car, DO NOT LET THEM PUSH YOU AROUND, they will try to get away with whatevery they can.
Running a diagnostics through another mechanic will cost money, and honestly, why should you have to pay a DIME when you just bought the car!?
I used to work for a car dealership, and trust me they are ALL shady, and will try to get away with whatever they can, talk to a manager.