This is a common problem which doesn't have to cost you an arm or leg to repair. There are four main faults typically associated with this problem:

Faulty Charger 

Make sure you are using a good quality charging cable and that it is working correctly. Often the cheaper cables actually can cause other internal damage to your phone.

Faulty Charging Port

This is quite easy to fix, all we have to do is replace the part as seen in the pic. We can do this for roughly R500 depending on which phone you have. A tell tale of this fault would be that your phone sometime takes a charge and sometimes doesn't, or it's not detecting at all when you plug the charger in.

Faulty Battery

Just like a car battery, a cell phone battery has a life span. Using bad quality chargers could also shorten the lifespan of your battery. A common tell tale of a faulty battery is that it will decrease from 100% to almost 0% very quickly, like in a hour or two. Another tell tale is that the phone might turn off even though it says it has about 30% charge still.

Damaged IC on the Motherboard

This is the least common fault but it does happen. It probably happens as a result of water damage or a power surge. Another reasons why it's important to only use original quality charging equipment.