The entire molting process is actually comprised of several stages, which includes preparing for the molt, the actual shedding of the exoskelton, and the hardening of the exoskeleton and recovery period. The actual shedding of the old skeleton does not take very long, but the stages that proceed and follow the shedding often take a while to complete (and are stressful and critical stages as well).
It is not unusual for an average sized crab to spend about 4-8 weeks going through the whole process, during which time it may stay completely buried in the sand. Some crabs, however, complete the process in a significantly shorter period of time, while large crabs may take longer.
As hard as it is to not know what is going on with your crab once it has buried itself, it is best to leave a hermit crab alone and let nature take its course during molting.
Go To Hermit Crab Molting FAQ for more on molting hermit crabs