With Mojave (macOS 10.14), why does the Message app close itself?
Solution 1:
This is a feature introduced in macOS Lion 10.7 in 2011. If you're only noticing this since Mojave, that's a bug or the following setting you changed previously has been reset to default.
By default, since Lion, apps which support automatic termination with no open windows and not activated will quit after an idle period.
To disable this for all apps, override NSSupportsAutomaticTermination:
defaults write -g NSSupportsAutomaticTermination -bool false
To find apps which support automatic termination in your /Applications folder, you can use
grep -nl NSSupportsAutomaticTermination /Applications/*/Contents/Info.plist
Note that automatic termination is distinct to functionality more commonly used by third-party apps: applicationShouldTerminateAfterLastWindowClosed(_:).