When I login back in Ubuntu 12.04, all my opened files are automatically closed and I have to open it from the first. Why it happens so? Do I need to change any settings? Anyone, please help me to resolve this problem!
When you logout or shutdown/reboot, all your open applications/windows are closed first. That's why you have to reopen them when you login again.
Previous versions of Ubuntu/GNOME had an option on to "save session" when logging out, which is what you may be referring to. Unfortunately, this is not currently possible with Unity on 12.04; your best alternative if you need this feature is to hibernate your computer instead of logging out/shutting down.
Please see this answer for more information: http://askubuntu.com/a/143616/58612