To hang a door you must install the jambs so they are plumb and parallel, and far enough apart to allow proper clearance for the door to swing.
The jambs, door, and hinges of pre-hung doors are all included in one package, sometimes already assembled. If you have an assembled unit, pull the hinge pins to separate the door from the jamb. If it's a knocked-down unit, cut the head jamb to length and nail the jamb set together. If necessary, trim off the excess at tops of side jambs so they fit in the rough opening with at least ½-inch of clearance.
Position jamb set in rough opening, centering it between studs. Place pairs of shims between jambs and studs. Drive 12 (12d) finish nail near top hinge, penetrating shims behind jamb. Drive it all the way in except for final ¼-inch.
Check hinge jamb for plumb with a long level, adjusting shims in or out until entire jamb is straight and plumb. Drive 12d finish nails through center of jamb at each hinge location. Level head jamb by adjusting shims above it and nailing into header. Measure width between jambs at top of door, making sure door will be able to shut between them. Maintain this distance between jambs at each point where you adjust shims behind the latch jamb. Check it with a long level. Hang door and close it from time to time as you finish nailing the latch jamb. When you are finished, score free ends of shims and snap them off.
To install the door lock assembly follow manufacturer’s instructions. The size of the hole and its distance from the edge of the door will be specified.