It's more like waiting 2-3 days after roasting. Beans should ideally be used within 2-4 weeks of the roast date, with darker roasts/blends being more forgiving.
For espresso at least, the advice is to let it rest for 1-2 weeks after roasting. Roasting traps CO2 in the beans, and the aim with resting the coffee is to let some of it escape. It’s especially important for espresso but resting filter blends up to 2 weeks after roasting is becoming common advice too.