I would guess that something you're running has a memory leak or other resource leak (file handles maybe?) that's eventually running the system out of free resources.
I recommend that you update all the way to the current release of macOS, which, as of this writing, is macOS Mojave 10.14.5. It's free. Untold numbers of bugs have been fixed in macOS since that ancient build you're running. Also, I don't even know if El Capitan gets critical security updates any more. Sticking with ancient versions of macOS used to be fine before computers were connected to the Internet all the time, but nowadays with always-connected computers, you need to always keep your OS fully up to date or you're like an anti-vaxxer, ruining the Internet's herd immunity.
If the problem still occurs with Mojave, consider leaving Terminal and Activity Monitor open overnight, so that you can still use try to use those tools to debug the issue in the morning even when you can't launch any other apps.
If you know one of the apps you're leaving open is a resource hog, consider not leaving it open overnight. Some of the most famous resource hogs include Google Chrome, anything that embeds Chrome/Chromium, iTunes, and Microsoft Office apps.
Consider using the Console app to look at your System Log and other logs to see if you can glean any clues as to what's going wrong or what resource is being depleted.