How long does it take a character to recover from ability score damage (e.g as a result from an intellect devourer's Devour Intellect ability)?
There is no general rule
There are no general rules for recovering from reductions to ability scores. Each case is taken on its own. Some, such as the reduction from an intellect devourer's Devour Intellect attack list no means of natural recovery. You must cast greater restoration to end this type of reduction. Some effects, such as a shadow's Strength Drain attack specify exactly how long it takes (emphasis mine):
the target's Strength score is reduced by 1d4 [...] the reduction lasts until the target finishes a short or long rest.
A feature will tell you if there is a way to naturally recover from ability score reductions. Otherwise, there is no amount of time that can help you.