How to stop my High Sierra quit all my programs when I log out or go to sleep?
All programs always quit when you log out. Nothing will change that. You can go to the Login Window WITHOUT logging out, by choosing "Lock Screen" from the Apple Menu (on newer OSes) or choosing "Login Window" from the User menu. That will bump you to the login screen while keeping the current user logged in, and all programs open.

No programs should ever quit when you put your Mac to sleep. I'd like to hear more about this because there must be some other thing going on in this situation.