It may seem like too simple a question -- but it's a good one. When changing a door, we often just measure the door itself and get one to match. But if you want to replace the entire frame, you are best to take the trim off around the door and measure the size of the rough opening, from stud to stud. And then measure the door as well.
When you go to the store and measure the outside dimension of the door frame, it must be one inch less than the rough stud-to-stud measurement. You need that inch to adjust for things being out of square.
You might also want to measure the two diagonals on the door opening. If they aren?t the same, your house has shifted and the door needs to be even a bit smaller to fit -- it has to fit into the space that is left after you square up the hole. You can always buy both doors and windows made in custom sizes to fit non-standard openings.
If you are having a professional install doors or windows, always let them take their own measurements. That way, if it doesn't fit, it is not your fault, and you are not responsible for the cost of getting the right window ordered and delivered.