KDE and its applications support sessions. This feature allows the system to save the state of all applications that are in use when the user logs out of the desktop environment, and to restore them when the user logs back in.
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 the button. The settings are effective the next time you log into KDE.