Measure the horizontal distance along the basement floor from the point immediately beneath the top of the stairs to the bottom of the stairs. Cut two each of your two-by-fours to this length to serve as the top and bottom plates of your wall. If your basement stairs descend into the center of the basement and are open on both sides, you will need to build two walls rather than one.
Measure the vertical distance between the basement floor and the underside of the ceiling joists next to the staircase. Subtract 3 inches from this measurement to get the length of the studs for the wall.
Lay the top and bottom plate together on edge and mark off 16-inch increments along their length. Count the number of marks to determine the number of studs you need for the wall.
Lay out the wall on the basement floor. Separate the top and bottom plates and lay out the studs between them so the ends of the studs butt into the faces of the top and bottom plates. Nail the wall together by driving two nails through the plates and into the ends of each stud.
Stand the wall up and position it next to the stairway so that it butts up against the outside face of the stair stringer. Secure the top plate to the underside of the ceiling joists by driving 3-inch-long screws through the top plate and into the floor joists.