I pressed P and I don't know what happened Yesterday I was making a model. There was something that I needed to put on another layer. I forgot the layer shortcut, so I was pressing random letters until I pressed (Ctrl +?) P and it changed the lighting and completely froze. I left it on for a while to see if it would unfreeze, no luck. Today I opened my PC and all I can see in the blender window is my viewport surrounded by black. I really don't wanna close blender since I didn't save my model.

P.S. It is still responding but I can't do anything with it.
P used to be the key to start game mode.  I think they unbound it in recent versions to prevent people from having this problem.  (yes, I also fell victim to that once; and the Shift+Space toggle).

I agree with all the comments suggesting the Esc key as a possible remedy.  (although it won't get you back from Shift+Space; another Shift+Space does).