Try turning off (not sleep or hibernate, but off) the laptop and see if it will charge then.
If it will charge while turned off, but not while turned on, then your charger may be in need of replacing. A common problem, when they start to go bad, is that they can't put out enough power to both run a device and charge its battery at the same time. So they will only charge the battery when the device is turned off.
Now it if isn't charging, even when turned off, it is not likely the charger, but it could be the charging circuit on the motherboard.