This story shows how to frame for closet doors.
The term "framing" here refers to installing the jambs into a rough opening for bypass or bifold doors. These closet doors are not available as prehung units.
A 6-foot-wide closet opening is most common, but you can install closet doors in an opening of just about any width. Sets of bifolds are available in a variety of widths (in multiples of 2 inches) and bypass doors can be cut to any width desired. The standard height is 80 inches (the same as for an entry door). If you have an older home with 9- or 10-foot-high ceilings, this can leave you with unusable space above the doors. Either build shelves with small doors above the closet or custom-make bypass doors that are tall enough to suit your situation.
Once the rough framing is completed, about 3 hours to build a finish frame (jambs) for a closet
Miter box or power mitersaw, circular saw, tape measure, hammer, drill, level, framing square
Measuring, using a level, cutting, fastening
Remove jambs from an existing opening, or build a new rough opening.
Jamb stock or 1x lumber the same thickness of your walls, casing, finishing nails, shims
If you do not already have one, build a wall for the closet, with a header above. A header that spans 6 feet should be made of 2x8s or larger, even if it is not load-bearing. Check that the opening is the correct size for the bifold or sliding doors you will install. Measure the diagonals to be sure that the opening is at least within 3/8 inch of square and ensure that the sides are plumb and the header is level.
Finish the opening by installing drywall on each side. Buy three pieces of jamb stock -- two for the sides and one for the header -- that are the same width as your wall's thickness. If your wall is an odd thickness, rip pieces of 1x finish-grade lumber to the correct width.