Tempo runs are sustained efforts at an intensity greater than your normal easy training run. The distance covered and the pace will vary according to the goal race, with a shorter, harder effort for races 10k and under, with longer, less intense efforts for half-marathons and marathons.
Generally, the shorter races will dictate a tempo effort of approximately 3 miles done at approximately 10k pace, while the longer races dictate a tempo effort of 5 or 6 miles done at slightly slower than 10k race pace.
You don't have to go to a track and do exactly 3 miles, or exactly 5 miles. An approximation is good enough. That said, it is beneficial to do your interval portion on the same course each time so you have times to compare as your training program progresses.
In the early part of your interval segment, it is important to start out at a pace you can maintain for the duration of the hard effort. It is counterproductive to start out so fast you have trouble holding the pace. Often the pace from session to session differs depending on environmental conditions, a bad day at work, the feeling in your legs, how well rested you feel, etc. This is of secondary concern to how consistent you can keep the pace during that particular tempo effort.
The tempo effort should be hard, but attainable. If you are slowing down midway through, you started too fast and should adjust the next time.
With any speed work, remember to warm up with ten minutes of easy running before the hard efforts, and allow for a ten minute easy run at the end as well.