Whenever you hang a door, you need a jamb. It's the frame that encloses the door, and you usually nail it to the studs surrounding the door opening. An important part of the jamb is the door stop, which is a narrow strip of wood that runs the length of the jamb on all three sides. It's easiest to install it after you hang the door, so you can fit it tightly against the edges when it is closed. Door stops not only hold the door in place, but close the gap between the door and the jamb.
Measure the distance along the top jamb from one side jamb to the other. Mark this distance on a length of ½-inch-by-1-inch lumber and cut it out with a handsaw. You can use any kind of wood for the stop, but it's best to use the same wood as you used for the jamb, which is usually pine or fir.
Close the door and engage the door knob barrel with the strike. Set the stop tightly against the door, on the opposite side from which the door swings. Partially drive two 1½-inch finish nails near the ends to hold it in place.
Measure the distance from the underside of the stop to the floor, or the bottom of the side jambs, whichever is higher. Cut two more pieces of 1½-inch-by-1-inch lumber to this length.
Set the two side stops tightly against the closed door and wedge them tightly against the top stop. Partially drive two nails into each to hold them.
Drive nails along the stops at 12- to 18-inch intervals. Keep the door closed as you do this. If the wood is warped, bend it tightly against the door as you drive each nail. Pound all the nails in until the heads protrude about ½-inch, then sink the heads with a nail punch.
Fill the holes made by the nails with wood filler. When it dries, sand the stops with 120-grit sandpaper in preparation for painting.
It's a good idea to test the door before you sink the heads of the nails. If you pushed the stop too tightly against the door, the knob may not engage easily. You may be able to tap it back with a hammer, but if not, reset nails as needed. Use thicker wood if 1½-inch lumber does not completely cover the gap between the door and the jamb. Bevel-cut the ends of the jambs where they meet in the top corners if you want a more professional look.