What does my textbook mean by saying this about petroleum?
Petroleum is a mixture of many different compounds.
Some of those compounds are gas.  Some are liquid.  Some are solid.
Many of them are hydrocarbons, and there are many different hydrocarbons included in the mix (e.g. different numbers on the C and H).
Petroleum is generally refined into more specific products before use, at a refinery.
Another example to consider might be "mud" - that's a mixture of some liquids, maybe some dissolved gases, and a bunch of different solids, usually including clay, maybe a bit of gravel, and some organic materials formed from decaying plants and animals.
If you take mud and compress it underground for thousands of years, then you'll have petroleum. 

The second sentence seems clear enough.