KDE and its applications support sessions. This very nice feature allows the system to restore all applications that were in use when the user logged out of the desktop environment.
Please keep in mind that non-KDE applications, and even some KDE ones, might have limited session support. The degree of session recovery is up to the application, ranging from just opening the application again, to opening it along with all the files that were open inside that application.
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.