2-3 weeks is conventional wisdom for low to mid gravity ales fermented in the 60 degree range. The best answer is to use a hydrometer and take samples of your beer with a wine thief. Measure the specific gravity after you've noticed fermentation beginning to slow down and when the gravity readings are the same for 2-3 days in a row, the primary fermentation has completed. The beer will benefit from a "diacetyl rest" of one more additional week on the yeast, as more basic fusel alcohols will be consumed by the yeast into more complex (and flavorful) alcohols.
Higher gravity beers, such as those with an original gravity (OG) over 1.070, can take longer to ferment. Cooler temperatures and lager style yeasts/techniques can also require longer fermentation times.