Use another charger and see if it will make any difference. If the phone is charging normally with no issues, the answer is clear. You will have to get a new charger.
Charge your device via USB cable. If it works normally, next time when the charging is required, use the wall charger again. Perhaps it will work just fine, because for many users, changing the method, and using the wall charger after, was helpful.
Maybe the charging port of your device is full of dust and dirt. Use a toothpick, or needle, and slowly clean the area.
If there is a new iOS version available, make sure to download and install it on your device. This simple step solves many current issues with the device, and you can do it wirelessly, or via iTunes, it is up to you.
Sometimes, all your device need is a fresh start. Back up your files, and proceed. Go to Settings, tap on General, Reset, and choose Erase all content and Settings. Set up your device as new.