When you ride your bike on asphalt and then a dirt/gravel road, that is called Cross Country riding.
You will need to buy a special bike for that. Then you will have your XC bike, Road Bike, Gravel Bike, Hybrid, Commuter bike, Wet Bike. .... and the CX bike too. More bikes to buy.
I forgot Mountain bike, Trail Bike, All Mountain, Enduro, and Downhill.