The short answer: how deep should a closet be comes down to one measurement you already own. A standard adult hanger is 17 to 19 inches wide, and once you add the hook, the rod and a couple of inches of clearance behind it, you arrive at 24 inches. That is the whole derivation, and it is why 24 is the number every builder uses. Go shallower and coats rub the back wall. Go to 28 or 30 inches if you store bulky outerwear. Then there is the second number, where the guides disagree completely: rod height is quoted as either 60 inches or 66 to 72, and both are right, because they answer different questions.
Disclosure: this post contains affiliate links, and as an Amazon Associate I earn from qualifying purchases. If you buy through them I may earn a small commission at no extra cost to you. I only recommend things I would use in my own home.