It might be a overheating self protection.
See this support article:--> If your iPhone, iPad, or iPod touch gets too hot or too cold - Apple Support
Read also the section "If your device stopped charging at 80 percent" in this page:--> If your iPhone or iPod touch won't charge - Apple Support
If the issue persists, for your peace of mind I suggest that you make an appointment (*) and have your device inspected at an Apple Store or AASP (Apple Authorized Service Provider) among this list:--> Apple – Location Selector. After checking it out, they'll give you all the available options.
Regards
Giulio
(*) You can do it: