The second worst thing to a rat running around your property and spreading out all types of diseases is a dead rat decomposing in your attic for instance. The odor which it causes could be quite uncomfortable for a good period of time causing nuisance for the whole family.
Let's just put it that way. If you have previously experienced it, then you know it and if you haven't, then congrats this is the smell you will remember for the rest of your life. Best put, the smell is a mixture of body decomposed chemicals such as methane and sulfur dioxide. I do not believe there is a certain adjective which could describe it properly, but it is basically what death smells likes.
And as you know, bad news come in pairs so right off the bat, we would like to state that there is no particular formula which you could use to calculate how long the smelling will last. It could be a few days or a few weeks. There are plenty of factors it depends on. The bigger the body, the longer its odor will last, a little mice's smell could be death with within a day, while a dead rat's could last a week. The other big thing is how fast the person will respond to the smell.
If you waited for it to be distinguishable, then that's already too late on many levels. It means that the creature has been dead for a couple of days and its body has begun decomposing. If you remove a dead rat as soon as it dies, you could prevent a long lasting nasty smell. The other factor is the humidity in the area. The more intense it is, the worse the odor will be. A dead rat near a steam pipe is something we wouldn't wish even to our worst enemy.
This might be obvious, but identifying the location of the corpse is the first thing. If there is an increased presence of pests, that is the place to go. They are attracted by the dead creature. In some cases, the body fluids go out of the carcass, so a stain somewhere is also a good clue to discovering the location.
Removing the body is the next step. Do that with caution; do not use your bare hands to remove it. Rats are one of the largest disease spreaders around the world; you don't want to touch its body with rubber gloves or some kind of other equipment. If you are lucky, the animal would have died on a location that is easily reachable, in other cases you might have to go through the ceiling tiles or other obstacles, which would have to be replace later on.
Once you dispose of the carcass proceed to clean the area with bleach and disinfectants. Don't miss a spot just to be safe on the health side of the problem.