When I am out, of course. I trust my flatmates but I wouldn't know who they might bring back. Also, in case someone breaks into the corridor, I want my room protected.
I lock it when I am in the kitchen, cooking dinner. My room is the first when you walk in. Sometimes the main door is kept unlocked, so again I don't know who might walk in.
When I am in the room I try to leave it unlocked, as it is a bit awkward if someone knocks on my door and I have to unlock it! It feels like I don't trust them. I obviously lock it at night, when I'm changing and when I'm in my bathroom.
In freshers' week I left my door wide open as I didn't want to shut myself off to other people.
I would advise locking it until you feel comfortable. It took my flatmates a few weeks before they could leave it unlocked when they weren't in there.