Without headers of the proper size, your walls could fall in. Window headers support the roof and other structure above a window; if you choose a header that is too small, its weakness could lead to a collapse. The International Building Code (IBC) dictates the sizes of headers to ensure that they will provide enough support, and municipalities everywhere adhere to this code or a modified version of it. Typical units used by builders will adhere to code, but if you are building a home on your own, you need to educate yourself about headers and their acceptable use.
The window header is the horizontal piece at the top of the window frame that takes the load from the shortened studs above it, which are known as the cripple studs. The pieces on either end and perpendicular to the header are called the trimmers. These attach to the studs on each side of the window for support. Sometimes you will need more than one piece of wood under each end of the header for the trimmers, depending on the size of the header you are using.
Factors for the window header depend size are numerous: the size of your house, the wind load on the wall where the window is installed, the amount of snow you typically get in your region, whether the wall is load-bearing or not, the opening of the window and the type of wood used in the framing. These mean that the code varies depending on your region. Guidelines in the International Building Code requires you to use these factors from the building to find the needed header size on a series of charts.
The header should be at the top of the window frame. To match the rest of the room, it also needs to line up with the door lintel, which is also called a header. Aligning these at the same height will make a room appear even and make measuring the cripple studs above the doors and windows easier because they will all be the same length.
The length of a header can be measured from the size of the rough opening for the window plus the width of the trimmer studs, sometimes called jack studs. For load-bearing walls, you will need to use a 4-by board for the header or two 2-by boards on either side of a piece of 1/2-inch plywood. The maximum span for a #2 Douglas fir 4-by board as the header is generally equal in feet to the depth in feet of the board. For instance, a 4-by-4 board would span a maximum 4-foot-wide opening.