Why does the wallet keep locking itself?
It locks after 15 minutes without interaction, and whenever you close the browser. The timer slides: any use of the wallet resets it, so you will not be locked out part-way through a transaction.
Locking clears the unlocked session only. Your wallet, accounts and settings stay exactly where they were — unlock with your password and everything is as you left it.
If a website asks for something while the wallet is locked, you unlock first and are then taken straight to that request.