This rule goes for not only cravings but truly anything like reacting quickly to a boss, friend, etc. Give yourself 24 hours before doing anything you might regret. This applies to that must have food craving to over-reacting to your boss/spouse. This rule stops you from being impulsive.
The 24 hr. rule means I will give it one day. If I'm still having that craving then I will plan my meals/exercise accordingly, plus tell someone. Usually, that craving goes away. This rule also applies to reacting to someone that can have negative consequences.