Your account has not been hacked (or if it was, it's not related to this problem). You are automatically logged out after 60 minutes by default unless you ticked the box on the login page that says "Always stay logged in", in which case you will never be logged out unless you click the Logout button or clear your cookies (this is a dangerous option if you are using a computer that other people have access to, which is why this option is not the default).
To avoid losing your posts, it is wise to always do a quick Select All + Copy (Ctrl+A, Ctrl+C) immediately before posting, so that you can just Paste (Ctrl+V) it into a new window if anything goes wrong.
Thanks Foxpup. I think it was the 60 minutes issue. I noticed if, instead of logging in from the home page, I log in from
https://bitcointalk.org/index.php?action=loginI can change the amount of time to stay logged in. The problem hasn't happened to me recently, so I'm a happy camper.