How long you let the beer ferment is dependent on your goals, so there is no definite coverall answer. Styles which benefit from very "fresh" hop flavors such as session IPAs should have short fermentation and shelf life to keep their volatile flavor compounds intact. However some high-alcohol beers and wild ales benefit from very long fermentation, even years at a time.
Yeast will continue to ferment over time, though fermentation will slow to a crawl once the majority of fermentable sugars have been converted to CO2 + alcohol. In general, the beer will become gradually "dryer" and stronger through this process, although there may be unfermentable sugars, such as dextrins, that remain behind permanently and contribute body and sweetness.
In terms of timing, there is no specific need for you to cut your fermentation short. A primary fermentation of 1-2 weeks, followed by racking to secondary for 2-4 weeks is sufficient for most styles. Adding additional time may help with clarity and allow any harsh flavors to mellow and mature.