Consider the purpose of your runner. This may sound like common sense, but if you're purchasing a runner to cover unsightly stains or scratches in a hallway, the dimensions of the runner must be larger than the area that you aim to cover. If you're trying to hide unsightly flooring, the runner should be as large as possible -- from wall to wall, or close to it. There's no right or wrong dimensions for a carpet runner, so the function of the runner should take precedence.
In general, 6 inches on each side is an acceptable distance between the wall and the runner. If your hallway is 3 feet wide, for example, then a 2-foot-wide runner should be adequate. For wider hallways found in more public areas, you may consider a runner that leaves more space between its edges and the wall. Look for a runner that's at least two-thirds of the width of the hall. If possible, the space around the carpet runner should be equal on all four sides. If this isn't possible, be sure to center the carpet runner so the spaces found on opposite sides of the runner are equal.
You can experiment to see which dimensions work for you by purchasing a roll of butcher's paper. Lay the roll down in your hall and trim it to the size that looks best. Measure the dimensions and make a note to keep with you when you shop for your runner.
If you happen to find a carpet runner that's larger than the ideal size, it may be possible to have it altered. Some businesses that sell rugs and carpets will do in-house alterations. Ask the clerk at the store for details. If your area runner is purchased used or from a home improvement store that doesn't specialize in carpet sales, you may just have to live with imperfect dimensions, or keep shopping.