There are many scenarios in which carpet needs to be dried, there is damp carpet, wet carpet, and soggy wet carpet. Each of these have a different dry time.
Soaked or sopping wet carpet is usually caused by a leak or flood. This type of wet carpet will take much longer to dry and will be much more labor intensive than other cases. You will start the drying process by soaking up any puddles of water with towels. Then you'll get a shop vacuum and suck up as much of the water as possible. Once the carpet is as light in weight that you can get it, take the carpet out doors to dry (do not place in direct sunlight). This process can take anywhere from 24-72hrs to dry depending on the style of carpet. Now your job will be to tear out the padding, this will need to be replaced. Carpet padding is usually made of recycled materials and is not made to withstand any flood damage.
To prevent any mold in your future the best thing to do is remove the pad and buy new. Typically in most homes they have a plywood subflooring underneath their carpet.. if this is the case for you, the faster we get everything wet off of it the better chances we have to save it. Drying subfloor usually takes about 24-48hrs. To dry the subfloor a little faster, you can set up electric fans around the room to dry the wood. Once everything is dry and you've purchased new padding you can reinstall.
Let's start with carpet cleaning. In this case you've cleaned your carpets and now they are wet to the touch and you're unable to walk on it. Fans need to be set out to dry the floor anywhere from 6-12hrs and maybe longer depending on your style carpet.
Damp carpet is typically from a small spill and usually only gets the top potion of the carpet wet and not the padding nor the subfloor. This type of wet carpet only takes about 6-12hrs to dry. You can help move that time by faster if you use towels to collect some of the water and also by vacuuming up that damp area as well.