I have a couple of articles for you that can help you troubleshoot this issue with your iPhone. First, here is an article that addresses your question specifically:
Battery does not charge
- Verify that the outlet being used is working.
- Try another USB power adapter if available.
- If no other USB power adapter is available, try connecting to a high-power USB 2.0 port (not a keyboard). The computer must be turned on and not in sleep or standby mode.
- Try another USB cable if available.
Next, here is an article that will help you if you are having issues related to being unable to turn the phone on:
- Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
- Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIs and corrosion.
- Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
- After at least 30 minutes, if:
- The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
- The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
- Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
- If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
- If the display turns on, go to step 4.
- If the display remains black, go to next step.
- Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
- If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.
Take care, and thanks for visiting the Apple Support Communities.