I created a wallet and gave it a password. Now when I click on Electrum on my Mac it allows me to open the wallet without entering a password. What if someone just walks over to my computer and does the same? Is there a way I can password protect the wallet from being opened?
No, not with build in methods. Put the wallet file in an encrypted container. Honestly though, lock your screen, set a user password. If someone can just walk by your computer and see your bitcoin balance, they can also install software, maybe even with enough rights to read your password and send it to their mail the next time you enter it.