Same as staehpj1, except I do lock the bike even in small towns if I'm going to be away from it more than 5 minutes or so. It only takes a second to lock it. If I can't lock it to an object, I lock it's wheels to itself.
If I'm going to be away for many hours, like if I'm going on a hike or something, I try to find a safe indoor place to leave it - like the tourist information center. Once when I went to the movies I asked the ticket taker, and they offered to put it in a back room for me. But if I can't find such a place, I'll usually do whatever it is I want to do anyway - the whole point of the journey is to explore & enjoy new places, so I wouldn't want worry about something getting stolen to ruin that.
As to at night, I bring all my bags in the tent with me and lock the bike to something solid - tree, fence, picnic table.
Valuables come with me at all times - wallet, passport, camera - in the handlebar bag. The one tour I had to bring a computer I started by keeping that in the H.B. bag too, but it made the bike handle poorly, so I just took my chances & left it in the pannier. I think not displaying your expensive toys will go a long way towards not getting them stolen.
I only have toured in 1st world countries, where it would not be the total end of the world to lose the bike, though. I guess if I was going to Mongolia I might want a companion to take turns watching it.