A professional roaster told me at least a week. I brought them green beans which they roasted and phoned me after a week (telling me that before that would be too soon and taking a chance) to come pick up.
That being said, the best coffee I've had was Ethiopian style, roasted dark and brewed right in front of me with no rest.