It varies. I roast at home, and some beans are great the next day. Some are great the next week. The cafe I used to live next to would rest their beans for a week.
That being said, the best coffee I've had was Ethiopian style, roasted dark and brewed right in front of me with no rest.