Most children have probably heard from their parents that they must wait at least an hour after eating before hopping into the water for a swim. Otherwise, they could suffer cramps and drown. The theory behind this tale is actually pretty sound and has to do with a shift in blood flow in the body.
When you eat something, your body increases the blood flow to your stomach muscles to help with digestion. The larger the meal you scarf down, the more oxygenated blood your stomach needs for digestion. But this means less oxygen available for your arms and legs, which require an increased amount during exercise (whether you’re swimming, running, or cycling). Depriving your muscles of vital oxygen can lead to cramps, conceivably increasing your risk of drowning.
For recreational swimmers, the risk of getting cramps after eating is actually very low; your body has more than enough oxygen to share between your stomach and limbs. The real danger lies with those who eat huge meals before vigorous, triathlon-level exercise. Such cases can indeed lead to cramps and even vomiting. But even then, the medical consensus has long been that it’s unlikely to result in drowning; that is, unless the swimmer all-out panics and forgets how to float.
Source: Is it Dangerous to Swim Within an Hour of Eating? | Old Wives' Tales | LifesLittleMysteries.com