Hi, and welcome.
The only time I ever had a phone do that, the battery was bad. I would replace the battery (Anker makes very good replacement batteries, as do many others), and if the problem persists, I would contact the vendor. if it is still under warranty, they will probably just send you a new phone.
Hope this helps.