Most of the time you will be installing a pre hung door, that is, a common standard size. So follow the measurements for a common door and you can install the door of your choice.
The first step you want to take is to prepare your wall where the door will be installed. If you are doing a re-framing, you will want to remove the sheet rock to get to the studs in that area for your door. For a first time installation, frame the door before you stand it up. Leave the floor plate and ceiling plate, you will cut them out later.
Next you will want to get your door size, then set your king studs. These support the frame. For standard door sizes your measurements will be 36 x 80. You need to find the center, and then mark it on the floor stud. This is called your determining point. You will then come 20 3/4 inches from your mark outwards on both sides of the floor stud and make another mark. They should measure 41 1/2 exactly. After this process you will cut a king stud, a outside stud, and fit it to the distance between your floor plate and the ceiling plate. For a standard eight foot wall you should have a measurement of 92 5/8 inches long. Always make sure you measure your opening. After which you nail the king studs, always making sure that the inside bottom aligns with your mark on the floor plate. Using a level, it is important to align your upper portion of that king stud to your ceiling plate, at that point you will nail it into place. After this is in place you will then work on your header.
If you have reached this point your doing good. The next phase is to cut 2, two inch by twelve inch boards. They must be 41 1/2 inches long, and laying one on top of the other, on your floor like you are making a sandwich. After that you will nail them on each side. And wallah you have your header.
Now it's time to grab a helper, so they can help with lifting and holding your header between the king studs, and helping to nail it from the bottom. This is done on a diagonal, right into your king studs on both sides. Making sure you nail the top of the header into your ceiling plate. Next phase is cutting 2 studs that come to 80 1/2 inches long. This should measure the distance from underneath your header and your floor plate. These pieces are what your exterior trim that surrounds your door will be nailed to. Placing one on each inside king stud, making sure to wedge them in under your header. Always making sure the fit is snug up against the king boards. Next just nail them into place.
Now you want to measure your opening, where your door will be hung. The measurement should be 38 1/2 inces wide, for a standard 36 inch pre hung door. This will also allow for a doorjamb space. The final step is to cut your section of your floor plate out from the trimmer studs, doing this before you install the final project, your pre hung door.