Giving us some basic info like Laura asked would be helpful.
A typical USB port on a PC only delivers 0.5 amps or less, so if you are using your phone while charging this way, then your phone may be using more power than your PC port can deliver.
The other possibilities could be:
1. Your cable is worn or damaged and some of the wire strands have separated internally. This increases resistance and reduces the amount of power the cable can conduct.
2. Your USB receptacle on the phone is dirty or damaged.
3. Your phone or phone battery is defective.
4. Your AC power block may be failing, and is no longer delivering sufficient power.
You can rule out a few of these things by using a different charger and cable, or plugging a different phone into your charger. If you use a different charger and it works, then the problem is your charger. If a different charger does not work, then plug a different phone into your charger, and if that phone charges then you have a problem with your phone.