This is a good place to start:
The RF value is usually the only thing you need to change, and I would recommend the higher range of the suggestions listed in the article i.e. 24 for 1080p videos. I don't see the need to use handbrake for lower resolutions but if you must then 22 for 720p videos.
For 1080p videos that are really large (data rate > 10,000kbps), use RF values of 26.
Also, another awesome trait of handbrake is that it removes black bars from videos.