This could be caused by many things, but the cheapest and most common is a battery that has a failing cell. This is especially likely if you have your original battery still or you use your phone a lot.
Anker and PowerBear both make good replacement batteries that are available through places like Amazon. Original Samsung batteries work great as long as you don't get a fake. You should be able to pick up a good quality replacement for about $20-25 or so.