Your laptop's battery is one of its most important features
Laptop Battery Lifespan
Laptop batteries are rechargeable by nature. Every time you plug your laptop in -- such as when you're using it at home, at the office or any other place where you don't need to move around frequently -- your battery charges, permitting you to use it as needed when it's disconnected from the charger. Like traditional batteries, rechargeable batteries have finite lifespans, so yours will eventually stop holding a charge. If your laptop has some age on it, it's possible your battery could simply be worn out.
AC Adapter Problems
Your AC power adapter powers your laptop when it's plugged into a power source and transmits energy into the battery when your laptop isn't using it -- but it also doubles as a charger. The best way to determine whether this device is faulty is to remove your battery and attempt to use the laptop using the AC adapter alone. If the adapter successfully powers your laptop, the problem likely lies with the battery.
If you typically use the same plug for your laptop and notice one day that the laptop's battery no longer charges, there could be a problem with the plug itself -- whether the entire outlet is defective or the switch that controls it is flipped to 'Off.' Rule out this possibility by plugging your charger into a different outlet. If charging resumes, you know the plug you were originally using -- and not the battery or charger -- was to blame.
If neither your adapter itself nor the plug you're using seem to be faulty, the problem could be much more elementary in nature. Namely, an issue with some connection -- the adapter to the outlet or your computer, for example -- might be to blame. Additionally, many adapters have two parts, which are linked in the middle. Make sure the connection between these two halves is secure, otherwise current might not be able to travel across the junction.