One of the warning lights that can appear on your dashboard if your car detects a problem is the battery. If this light comes on whilst you are driving switch off all electronic devices that are running in the vehicle such as radio, air conditioning or heater and remove devices plugged into the car which could put strain on the battery.
Try to get to a safe location so you can stop incase it suddenly stalls. The problem could be coming from the battery itself, the alternator or fuses in the engine. If you are close to or are only a few minutes away from a garage take it to the repair shop.
If your car stalls during your journey coast to the side of the road and call your breakdown assistance such as the RAC or the AA. There is no way to tell how long the battery will last once the light comes on so it is best to be cautious and plan to stop as soon as you can.