Now and then I've seen people say under 2" is okay, or 4"-6" is okay (deep enough to act like a deep sand bed - e.g. much more anaerobic activity for helping to keep nitrates low), but between 2-4" is a so-called danger zone.
But I agree with Brandon. It's not about a hard set range of depth, it's about your tank. And about what you want it to do for you.
Do you want it to be a MAJOR aid in keeping nitrates low? If so, rule of thumb is it needs to be 4" deep or more. If you'll plan on relying on your live rock alone and/or marine blocks, carbon dosing, or another nutrient control method, the it won't matter.
Do you plan on keep wrasses that sleep in the sand? While some people may get away with less, the rule of thumb is at least 2".
Do you manually clean it or not.
What kind of clean up crew do you have.
What kind of bioload do you have.
Do you periodically refresh or replace portions of the sand.
If you don't periodically clean or refresh, do you leave the sand undisturbed.
All of these play a part. And any depth of sand can be successful or cause problems based on your tank, it's biome, your maintenance habits, etc.
FWIW, I ran a 2-3" deep bed on 24g for 4.5 years without any problems. Didn't clean the sand. But always kept lower nutrient levels, diverse clean up crew ... and I mean diverse. All kinds of worms, chitons, snails, etc. Good flow to keep detritus patches from forming on top of it.