KDE and its applications support sessions. This feature allows the system to restore all applications that were in use when the user logs out of the desktop environment.
By default, KDE automatically saves sessions whenever you log out of the desktop environment. To change the default behavior, open the Session Manager ( + + + -> from the main menu.), make your choices and click on the button once you are satisfied with your settings. They will be effective the next time you log into KDE.