How to exit User Preferences mode?
The way you should get to the User preferences is through the menu in the info window. That will open up a separate floating window, just click the regular windows close button to exit. (as in the first picture)  

Now I think what you did is change the editor type by clicking on the button in the very top left. If that is the case then just click on that same button and change the editor type back to the Info view. (see 2nd picture)