The human body is like any other animal body and when it is dead it will decompose (rot) and start to be broken down by bacteria and eaten by other animals such as maggots. This is why when someone dies in their house alone and is not found for a few weeks the neighbours often phone the police because they can smell a nasty smell. If someone is buried then this natural process will occur in the coffin underground. I would like to be cremated (burnt) so my body is turned into ash and can then be scattered somewhere nice rather than being eaten by maggots!
See Samantha’s answer. How quickly a dead body decomposes depends on a lot of things, like, how hot or cold it is, whether the body is inside or outside, how wet or damp it is, what kind of insects or other animals are around (and that can depend upon where the body is and what time of year it is). If you know all these things, you can work out when a body died by observing how decomposed the body is.