After the carpeting is cut to fit a set of stairs, you must finish the edges to prevent it from unraveling. One common method is to simply turn under the edges and tack them down to stairs.
However, to produce a more-finished, cleaner look, use a binding machine to finish the edges of the carpeting. The binding machine looks and operates much like a sewing machine, and is used to permanently bind the edges. If you can't find a portable binder, like the one shown here, bring the carpeting to a carpet installer. They typically have one in their shop.
Need More Info? Ask a question on Floors message board