There could be a number of reasons why your phone isn't charging. I'll list a few of them, but also beware that, unfortunately, these days phones aren't built to last.
Phone retailers want you to purchase a new model every 2 or 3 years, so it's become less and less common for a modern cell phone to survive for longer than that.
Why your phone isn't charging:
Charger port needs fixing - this is the most common problem with chargers. Something comes slightly loose inside the port where you plug your charger into the device. Sometimes this can be fixed with a little DIY, although taking it to a pro is a good idea if tinkering doesn't work.
Change cable - Often, it's not the phone - it's the charger itself. Most stores let you try a charger out to confirm that before you buy it.
Try a factory reset - If your phone is attempting to load before it switches off, then this could be a software issue.
Performing a factory reset usually solves this issue, and doesn't involve much more than plugging your phone into your PC/Laptop's USB port and running some reset procedure.
The actual process will vary from phone to phone.
Replacing the battery - This is a little bit more expensive, but batteries often go before the devices themselves get worn out. At least changing a better doesn't cost as much as a brand new phone!