Well it can be many things, including:
1) your memory is just way too full, and then the phone kind of gets nuts. Try to get rid of some of the things that make your phone´s memory full such as pictures, videos, midia in general, apps.
2) the battery has been used for too many cycles, so it is giving signs it is about to die...permanently
3) if you did jail break it can be a sign that there is something wrong with the OS
4) maybe you need to update the OS, sometimes we avoid updating and the support for certain apps and other things gets outdated
5) if the phone is way too old (say like 5 years old) maybe it is just "old age"
Hope this helps!