A good general rule of thumb is what we call the 3-3-3 method. At least 3 weeks in the keg to allow for complete fermentation, then 3 weeks in the bottle for carbonation, and then at least another 3 weeks for conditioning before drinking. That extra conditioning is optional, but it will drastically improve the flavor of your beer.