A suggestion… if the charging light comes on, don’t turn your car off and back on. At some point it won’t turn back on.
The light is telling you the alternator is not charging up the battery enough. If the battery is a bit drained - from multiple short starts or a sitting for a while - the light may stay on for as much as 15 seconds or so while then go out. That’s normal but its telling you your battery may need replacing or that something is being left on and running down your battery while the car is off.
If the light stays on, the car is running off the battery and will stop running some distance down the road. How far?? Depends on lots of things but don’t depend on it to get you to work. Have your alternator and battery checked.