If you do any major physical activity after eating, you may experience cramps; this is not exclusive to swimming. How long do you have to wait? It depends on what you ate. If you had a light snack you can start swimming immediately, but if you've just left a Vegas buffet, you may need to wait as long as two hours before you hit the pool.
If you do have a cramp, will you drown? Unless you're a really poor swimmer, no. You can get rid of a cramp the same way you do on land: slowly contract and relax the affected muscle. This can be done while floating.
In fact, long distance swimmers have to eat and drink during their swim to keep their bodies going. Typically they'll consume a high carbohydrate gel to refuel their muscles -- the same kind you've probably seen marketed to runners and bicyclists. This isn't better at preventing cramps than other foods, it's just convenient. World record holder Martin Strel has a different tactic:
Those bottles he's drinking from during his swims are full of Slovenian wine. On his longer swims, he stops to eat regular meals, either in the water or on a boat. Obviously, cramps aren't a concern.
So, do you need to wait an hour after eating before you go on a swim? Probably not, but if you wait a little while after eating you will be more comfortable. It's even possible to safely eat while in the water.
Posted 3517 day ago