Let me explain:
Friction is the resistance to motion between two surfaces that are in contact. The greater the friction, the less distance an object will roll. Carpets have a higher coefficient of friction than wood floors, so a ball will not roll as far on carpet as it would on a wood floor.