The light will come on when one of the many sensors sends an out of range signal to the computer. The computer then stores a diagnostic code which can be retrieved with the use of a scan tool. If you take it to a parts store, like Autozone, or others, they will retrieve the code for free and tell you which system/circuit is involved. If its running ok, then its probably emission related and we have seen alot of faulty gas caps cause this. It may be something that you can fix right there, if its deeper, post the code(s) here and we will point you in the right direction.
If you have further questions feel free to reply.