There are a few factors that affect the length of embalming. The quality of the process done is one factor. Embalming is done for a couple of reasons; preservation and to make the dead body appear natural. It is helpful for aesthetic purposes in improving the appearance of bodies after being ravaged by disease, car accidents or other trauma. Embalming is done for bodies that are going to be on display to the public (as for a viewing), if refrigeration isn't possible or when a body needs to be transported to another location.
Formaldehyde is a chemical used in embalming. It is mainly used to slow the decomposition process and restore a more natural look by coagulating the proteins in muscle, making the skin look firmer.
Another factor is location. Where the body was buried can either speed up decomposition or allow the body to decompose on it's own. Putting a body in a mausoleum will expose it to the heat in summer, allowing for accelerated decomposition. Water-tight caskets will keep everything out, letting the body decay on it's own.Learn more about Forensic Science