Measure the height of the doorframe: the distances from the floor to both the bottom of the header jamb and the upper edge of it.
Cut the new jamb leg to the longer of the two measurements. Subtract the difference between the two, and angle the upper edge downward by this distance, so that it will smoothly interconnect with the angled edge of the header jamb.
Slide the jamb into place and secure it with finishing nails. Shim it as necessary. Reattach the moulding on both sides of the door.
Screw the lockplate or hinges, depending on which leg you're installing, into place. Add a few extra nails around this point for added strength, but make sure that they are not all along the same grain of the wood.