Try charging it when the laptop is turned off (not sleep or hibernate but off) rather than on.
If it won't charge when on, but will charge when off, your charger is going bad and you need to get a new one.
If it won't charge no matter if off or on, then it is more likely the battery you need to replace. However, it could be both the battery and the charger.