Fossil fuels are the remains of organic material, such as plants and animals, which lived millions of years ago. Different fossil fuels are created depending on how long the material is buried, but it is generally accepted that the process takes millions of years.
Fossil fuels are the product of a sort of natural geological "cooking". Heat, pressure, and bacteria combine to slowly bake the material under thousands of feet of Earth. Fossil fuels used today formed around 370 million years ago, and the time it takes new fossil fuels to form is the reason they are considered non-renewable energy sources.