This is a question everyone should consider. It often depends on the person but generally you do not want food in your stomach when training. For some stomachs that is 2.5 hours before working out and 1 hour for others.
The stomach should be empty for a variety of reasons. The first is simply comfort. Those with sensitive stomachs may get upset during training from the stress placed on the body by anything from squatting to sprinting.
Another reason the stomach should be empty is so that the body can concentrate on one job, the exercise at hand. If the stomach is in digestion mode blood will be traveling their to assimilate nutrients. At the time of training we want the blood to be in our muscles performing the workout load. Since the body will always prioritize survival, eating will always be more important than training.