Let's say that you are basically a noob to cycling and aren't transitioning over to cycling from something like jogging or another athletic sport. Maybe you want to get more fit or maybe you just want to drop some weight.
You should be eating some food while you are riding on the bike. You'll have an easier time getting in shape if you do. Let me explain:
Depending on how much you weigh and how hard you are riding, you burn several hundred calories per hour. It depends exactly on how hard you are working, but some quick calculations suggests that the burning starts at 200-300 for a light person at a slow pace and goes well above 1000 for 20+ mph racing pace.
You've got all sorts of places where energy is stored, ranging from inside of your muscles themselves, short-term storage in your liver, and long-term storage in your fat cells, but all of them have a limit as to how fast you can draw from them. When you've exceeded the rate at which you can draw from the various sources of energy, you are going to feel tired and worn out. If you keep riding, eventually your body is going to give out on you. Right before this happens, the world will suddenly look REALLY vividly colored. At least that's what most of us report.
If you don't eat, you have an hour, maybe two, of energy stored up. But, if you do eat while you are riding, you can keep going for hours and hours. Pretty much, you can go until your muscles or tendons or rear-end start to hurt. I've dragged out-of-shape friends on long rides in the past and they were able to do it, once I forced them to stop once an hour and eat.
You will come out ahead this way. Let's say you bike for an hour and burn 300 calories. Compare that to biking for two or three hours and burning 600-900 calories. Even if you eat 100-300 calories while doing it, you will have burned more calories.
Finally, several-hour workouts at a long steady pace are really good for improving your level of cardiovascular fitness and burning fat.
And what should these calories be? Well, something easy on your stomach and fairly light. There are special sporting-related products that are generally right around 100 calories and super-easy on your stomach, but you don't have to go overboard. A piece of fruit or some candy or even a can of soda will work just fine. Just try to keep it around 100-200 calories maximum per hour.