Take your car to an AutoZone and have them read the stored codes in the OBDII system. The check engine or service engine light will go on when the system detects an issue, it will blink if there is a misfire as well. These code readers can also clear the check engine light.
A loose or failing gas cap is often the easiest trigger of a check engine light, but it is not the only reason it would be on. Once you get the codes read, you can post a reply here and the helpful group here can help you with the issue if necessary. Are you still under warranty?