You will definitely find varying opinions on this, but there are two main ideas to consider.
Many people find success with the 1-2-3 approach. This is 1 week in the primary fermentor, two weeks in the secondary, and then 3 weeks in the bottles.
The idea of skipping the secondary seems to have gained favour recently. So with this approach, you leave the beer in the primary for 3-4 weeks before bottling.
I personally leave mine in the primary four weeks before transferring to kegs. Your beer will be fine to leave in the primary while you are away. There is a risk to leaving your beer on the yeast for extended periords of time, but few have ever run into a problem.