My rule is that, when leaving the boat, I leave it as though I have no idea when or if I may ever return. That means everything pinned, closed, switched off, etc., for an indefinite period. You may promise yourself 'it's only for a few days', and then someone has some emergency that becomes a priority and next you know it's been three months and what began as a tiny dribble of a leak has become something much more that has overwhelmed the bilge pump which in turn has killed the battery and the whole boot stripe is underwater (or worse). Or some squall has caused the poor boat to drag its mooring and it's now sideways in some stranger's back yard. Or the mainsail you didn't cover is now in shreds all over the boom from the gale that blew through. Or... you get the idea.
The best idea is to have an 'away mode' in which you can safely leave the boat. Generally this includes (but is not limited to):
- some provision for ventilation
- deck tidied, poles secured
- sails covers drawn and tied down; boom secured on center
- tiller lashed on center
- all gear stowed below
- mooring lines adjusted (with chafing gear) and doubled if necessary
- garbage taken out
- fuel petcock shut off
- all seacocks closed
- electrical panel set to have only the bilge pump set on manual, the solar panels active, and the anchor light, if necessary, set on a timer or solar sensor
More importantly, having such a plan, you should follow it as a matter of course, letting no other considerations keep you from it.
NEVER trust in optimism. Optimism is for when you don't have a plan. Or, as I usually say, 'Prudent pessimism is the mark of a responsible yachtie (and private pilot).'