Duplo has a fairly wide age range — most children start around 18 months and are still happily building with it at 4 or 5. Knowing when it's genuinely been outgrown, rather than just going through a quiet phase, can be harder to judge.
The general pattern
Most children start showing interest in smaller, more detailed LEGO somewhere between 4 and 6, as their fine motor skills catch up and they want more complex builds. That's usually the point Duplo starts gathering dust rather than being actively played with.
Signs it's genuinely done
A few reliable signs: the Duplo hasn't been touched in several months, your child is asking for smaller LEGO sets by name, and building interest (if any) has moved to more detailed sets rather than chunky pieces. If it's just been a quiet couple of weeks, there's no rush — Duplo doesn't wear out sitting in a bin.
What to do once it's confirmed
If you've got another child coming along in the next year or two, it's often worth keeping a core set back. If not, selling it while it's still in good condition — rather than letting it sit for years first — is usually the more practical route, and it doesn't need sorting or cleaning first.