This answer depends on water extraction methods, the carpet type, and the length of water exposure.
Flooded carpets — 3 to 5 days
Wet carpets—12 to 24 hours
Woolen carpets take longer to dry than synthetics
Professional fans dry faster than regular fans