Have you tried the following:
- Go to System Preferences > Energy Saver
- Set computer sleep to Never (or an appropriately long period of time)
- Set display sleep to occur when you like
- Now go to System Preferences > Security & Privacy
- Click on General
- Tick the box for Require password...after sleep or screen saver begins
- Click on the drop-down menu to select how long after sleep you want the need for a password to be activated (Immediately, 5 secs, 1 min, etc etc)
- Exit System Preferences
Note, if you want you can also use the Screen Saver function to achieve the same thing. You would still do the above steps, but in addition:
- Go to System Preferences > Desktop & Screen Saver
- Select the Screen Saver tab
- Set the Start After option (at bottom left) to dictate when you want the Screen Saver to start - note you may want this to be set at a shorter period than your Energy Saver sleep settings (e.g. If you set your display sleep to occur after 15 mins, you may want your screen saver to start after 5 mins - this means your screen saver will be active for 10 minutes before your display will fully go to sleep)
- Choose any other Screen Saver options you like
- Exit System Preferences
If you have any problems/questions, let me know.