Up to 6 weeks is pretty good. The flavor can start to fade if you wait too long, and about 6 weeks is the point of diminishing returns in my experience with cherries. Of course you can bottle or keg as soon as the sugars are done fermenting, which happens pretty quick. All depends on your preference, style of beer, and whatnot. If there's some hop character you want to preserve, I'd package as soon as fermentation is done. Otherwise let 'er sit for awhile and extract as much color and flavor as possible.