It could be the charger, the battery, an app on the phone, or something else.
Test charging it while it is turned off (not sleep but off) and see if it charges fine. If yes, then I would try charging while in "Safe Mode" and see if it will charge fine in there. If it does, then you have something on the phone that is interfering, an app, etc., which isn't uncommon. If it won't charge without the restart, even in "Safe Mode" then I would try the charger, battery and if necessary have it looked at by a tech (or the manufacturer if under warranty).