If you're using Gnome, then when you click on the log out button, you're presented with a window which has 3 options:
Code:
Log out
Shutdown
Restart the computer
Above those options is a tickbox with "Save current setup" next to it - tick that box, and whatever you have open when you log out will reopen when you log back in, with some exceptions - I think it won't remember browser windows.
If you're using XFCE, then there's a similar setup: Log out, reboot or shutdown, with an option to save the session.
Don't know if this is the case in KDE, but from memory it remembers your session by default... I may be wrong on that.
In fluxbox there's a folder in your home directory called .fluxbox, and in that there is a file called apps (if there isn't you can just create a new one), if you want to open gaim when you log in, you'd add the following command to that file:
I'm afraid I don't know about any other window managers...