You can install bifold closet doors with or without stop. Here I will explain installing them with stop.
Stop is the trim piece that goes under the casing and on the inside of the bifold door opening. This piece forms the reveal on the inside of the casing around the door.
You can have a reveal or you can run the casing flush with no reveal. I usually don't leave a reveal that way its easier to nail the casing on since the stop only has a small area to catch the nail to.
First thing to do is measure across the top inside opening and cut a piece of stop so it fits snugly in. The stop usually has a thick side and a thin side. The thin side faces out in the opening flush with the outside wall. In other words the stop goes in the opening towards the outside corner of the opening with the thin part of the stop flush with the outside wall across the top of the closet opening.
Right now use 3 nails with the big finish gun and just tack this up spreading the nails across evenly.
Installing the track which the bifold closet doors slide in is next. If you look some sort of track should have came with the bifold closet door.
First thing is to cut yourself a small block out of some three quarter stock maybe 4" wide x 5" long.
Next at one corner of the opening hold this block flat against the back of the stop you just put up so you can draw a pencil line exactly three quarters of an inch away from the stop moving the block keeping your pencil line nice and straight and even all the way across the span of the opening.
Ok now you should have a pencil line across the top of the opening three quarters of an inch away from the stop towards the inside of the opening.
Unfortunately there are many different styles of hardware and different ways bifold closet doors are hung. Most include a track. The track may come in one piece or two pices.
If the track is one piece, center the track in the opening so both ends are even. Now move the track directly over your pencil line so you can see the pencil line through the screw holes of the track. If the track is two pieces do the same keeping the track together tight in the center.
Screw this track in place making sure it stays centered in place as you screw.
Bottom or Floor L bracket
Ok you should have a short piece of scrap stop at the saw.
Take this piece of stop and hold it in place at the floor where the stop will run down when it is installed.
Take out your 3/4 block and draw a line 3/4's of an inch behind this stop as like before only vertically at the bottom of the opening. Ok this is where the bottom L-shaped bracket which the bottom door pin will rest in will be mounted.
Again center the screw holes on this L bracket so you can see your pencil line. I usually will mount this bracket on a piece of 3/4 stock cut down to the size of the bracket keeping the door up 3/4 of an inch from the floor. This does vary however and you may need to add or subtract from this height depending on the height the opening was framed at.
Attaching The Hardware
Now its time to attach the hardware to the bi fold doors. There are many different styles. Some bifold closet doors have pre drilled holes in the bottom and top of the doors and its just a matter of pounding in the hardware in the correct holes. At any rate you will have to follow the manufactures directions to get the hardware mounted to the door and ready to install to the track.
The next step is again following the directions to mount the door to the track and again many different styles. I know from experience that these directions are sometimes hard to follow and understand so its best to just take a little break here and read carefully laying out the mounting hardware and understanding each piece of hardware, where it goes and how the bifold doors get mounted to the track.
Once you have the bifold closet doors mounted and adjusted in the center of the opening keep in mind the stop is suppose to cover the verticle cracks or openings at the sides of the bifold doors. Double check this with your scrap piece of stop to be sure.
If this is good the next thing to do is check the crack or opening across the top of the doors with the doors closed making sure it is even between the stop and door. If it is uneven at one end or the other just simply drive in some shims across, shimming the stop down where necessary making an even reveal all the way across and then taking your big nail gun shoot in a few more nails making the stop secure across the top.