The general consensus around these parts is that most beers don't really need a secondary.
That issue aside, total time between pitching your yeast and bottling shouldn't come in the form of a rule because beers take significantly different amounts of time to be ready. Early on, this can be tough to judge without experience, so most people recommend a total of 3-4 weeks on small beers for new brewers (with multiple gravity readings to ensure that sugar levels are steady). Once you have a bit more experience, it's easy to futz around with that time frame.