I am new to road bikes and was wondering if these bikes are capable of riding on light gravel or whether I will get flats? Does it depend on the tire material or are generally all road bike tires for road only?
The primary difference between a road bike and a CX bike is the size of the tires. You can ride your road bike anywhere your skills will allow. There are some gotcha's though.
Skinny tires only have so much traction. Gravel flats won't be an issue for all but the lightest of race tires, but pinch flats from hitting larger rocks at high speed are a problem.
Dirt and high end road components don't mix well.
But seeing exactly how far you can take a road bike has a long history and many local clubs have "grasshopper" rides that link up old gravel roads. Your bike is capable of much more than you might think. Look up the races Paris-Roubaix and Strada Bianca.
As other answers and comments have indicated, you can successfully ride a road bike on loose gravel.
There are five main factors, and they are all interconnected:
The depth of the gravel. The key to riding in gravel is smooth lines. Avoid sharp turns: the deeper the gravel, the more your front wheel digs in and accentuates any steering movement you make. This is what causes most falls in gravel. OTOH very shallow gravel, doesn't "grab" your wheel. It acts like ball bearings and when you try to turn your wheels just slip out from under you. So rule 1: smooth lines.
The speed you attack it. It takes experience to guage how fast to approach gravel; it's hard to explain. Approach a new patch of gravel cautiously. Then maintain a constant speed, even if it means getting out of the saddle to keep the power and speed up in deeper gravel. Rule 2: constant speed.
The width of your tires. The thinner your tires the more you sink into gravel. So gravel that's not deep for MTB tires is trickier for skinny road tires. Tires on a hybrid or touring bike are generally ok for gravel with practice. So for each bike you ride, rule 3: learn how it handles.
The geometry of your bike. A racing frame has steeper angles than a touring frame or a hybrid. The steeper angles accentuate the issues. So repeat rule 3: learn how it handles.
The kind of gravel. From light sand with grains of 1mm to coarse gravel with 1cm (.5 in) grains, to 5 and 10 cm (2 and 4 in) rocks. Basically, when the grains are near the width of your tires, it's time to slow down. When the rocks are bigger than your tires you are running serious risks of cutting your road tires: they're just not designed for this. Rule 4: The larger the gravel the slower you should go.
Many falls by gravel novices are due to not knowing the first two rules: smooth lines and constant speed. They are the key.
After mastering those, you can step up to gravel on uphill and downhill slopes, and corners. The same rules apply, but with downhill you have to add smooth even handed braking. On uphill you have to add smooth pedaling.
Enjoy. It's a great skill to have.
You are asking two questions, one about the bike and one about the tires. Road bikes can easily go on gravel, or even off road. However, the ride quality and handling will be compromised the more "off road" you go.
As far as the tires, the more you have "road" tires, the more flats you will have. This is due to the thin nature of road tires for less rolling resistance combined with higher pressure. Road tires have PSI (Pounds per square inch, a measure of air pressure) in the 100-120 range, with very thin tires (and tubes, if you use something like a latex tube) to reduce resistance.
Cyclocross tires are thicker, will sometimes have treads to handle grass, mud, water, etc. They will run anywhere from 24-40 PSI depending on type of tire and conditions. Once you go to mountain tires, then you are also putting on lower pressure, and you have much thicker tire and tube material.