Hello there Galamiton24,
We understand your iPhone is not charging as expected and seems to be not performing as expected. Let's take a closer look as we do our best to provide some additional insight.
To get started, if you're using a support model, go to Settings > Battery > Battery Health, do you see any service battery warnings at all? This can help indicate any obvious hardware issues with your iPhone's battery.
In the meantime, what kinds of app(s) are you using when you notice happening? The reason we ask is if you're using a graphics or processor intensive app, your iPhone may slow or pause charging to manage temperatures or those processes may use more power than what is supplied by the power adapter safely: Keeping iPhone, iPad, and iPod touch within acceptable operating temperatures
Otherwise, we'd suggest following the rest of these steps here: If your iPhone or iPod touch won't charge
If issues persist, then you'll need to have your iPhone serviced. If that's the case, contact Apple Support or make an appointment at your closest Apple Authorized Service Provider or Apple Store: Find Locations.
We hope this helps get you pointed in the right direction.
Take care.