Answer
Work is done when a force acts on something that moves in the direction in which the force is acting (page 110).
When the car rolls on level ground, the direction of the gravitational force is perpendicular to the direction of motion. There is no force component in the direction of motion; the work done is zero.
When the car rolls downhill (or uphill), the gravitational force has a component along the direction of motion; the work done by gravity is nonzero.