A general rule of thumb for primary fermentation is:
Ales: 14 days at 68F
Lagers: 30 days or less at 50F , sometimes a Diacetyl rest will be necessary for several days at 68F
This is also dependent on yeast strain. Some yeast strains are more active than others, and will therefore ferment faster than others. Experience is plus. Knowing how a particular yeast behaves will enable one to anticipate terminal gravity. The main factors to consider are the yeast strain, available oxygen, fermentable sugars and time.
The most important tool for the beginning brewer is the hydrometer. The air-lock is a good indicator, but the hydrometer can tell you when terminal gravity has been met. Once terminal gravity has been met, then the beer can be tranferred.
Let your hydrometer be your guide.