My computer logs out and sleeps after two or three songs play on itunes
Open System Preferences→Security &amp; Privacy, unlock the padlock if it's locked, and then in the Privacy pane click on the Advanced... button. See if you've enabled "Log out after [x] minutes of inactivity".