There are three different ways to add a knitted border to the edge of a knitted item. You can knit the border separately and sew it on, you can pick up stitches along the length of an edge and knit the border from the picked up stitches, or you can knit the border and attach it to the edge one row at a time.
Measure the edge of the item to which you want to add a border. If the border needs to go around a corner, add a little extra to allow for gathers at the corner. This is the length of the border you will knit.
Knit the border using the pattern you selected until it is almost as long as the measured length. The yarn you use should be about the same weight as the yarn used to knit the original item.
Slip the live stitches at the end of the border onto a yarn holder, and carefully pin the border to the item, easing the border around any corners.
At the corner, the eased border will show a little gather, like a ruffle. The more ease that you give at the corner, the more pronounced the gather effect will be. Adjust the ease until you like the appearance.
Determine exactly how much longer the border needs to be.
Unpin the border and return it to the knitting needles.
Finish knitting the border and bind off. Weave in the ends.
Pin the border to the item and attach it using the mattress stitch.
Pick up and knit the stitches along the edge of the piece to which you want to add the border. Use a large circular needle and yarn that is similar in weight to the yarn used to knit the original piece. As a general rule, pick up one stitch for each stitch along the top or bottom of the piece, and pick up three stitches for every four rows along the sides.
Knit the border, following the pattern you have selected.
Increase at every corner to create a mitred corner so the border will lie flat. As a general rule, you should increase the equivalent of one stitch every corner, every round. Be sure that you add the increase stitches equally on both sides of the corner.
You may prefer to increase two stitches at every corner every other round, placing one increase just before the corner and one stitch just after the corner.
Continue knitting until the border is the width that you want.
Bind off, and weave in the ends.
Cast on the number of stitches needed for the width of the border pattern. Or, use a provisional cast on.
Knit the first row of the pattern.
Knit the second row of the pattern, except that when you come to the last stitch in the row, knit it together with an edge stitch along the side of the original piece. Do not start in the corner.
Continue knitting the pattern rows. On every even row, knit the last stitch together with the next edge stitch of the original piece. You are joining the edge and the border at this stitch.
Turn the corners.
If you are making a narrow border, at the last stitch before the corner, make a double join. At the corner stitch, make a triple join. At the first stitch after the corner, make a double join.
If you are making a wide border, you will need to experiment to see how many double or triple joins you need to make for the border to lie flat. Or, follow your pattern instructions.
To make a double join:
Knit the last stitch of a border row with the edge stitch where you want a double join (first join). Knit the next two border rows as normal, except at the end of the second row, knit the last stitch together with the edge stitch where you want a double join (second join in the same stitch).
To make a triple join:
Make a double join. Knit the next two border rows as normal, except at the end of the second row, knit the last stitch together with the edge stitch where you made the second join (third join in the same stitch).
When you complete the border and reach the starting point, bind off the border and sew it to the cast-on edge of the border using a mattress stitch if you used a regular cast on. If you used a provisional cast-on, remove the cast on and join the two ends of the border with the Kitchener stitch. Weave in all ends.