Trekking in the high altitudes of Nepal is a physical and mental challenge and you should prepare yourself accordingly with a training program. In particular, the duration of some of our trips, such as Everest Base Camp or Annapurna Circuit, can be quite long and are quite taxing on the body, especially for newer hikers.
Being in good shape is important in many respects. Strong, conditioned legs make it easier to walk uphill and downhill for sustained periods of time. General aerobic fitness allows the body to function efficiently with less oxygen. And a positive mental attitude paired with determination can work wonders when fatigue sets in.
You should start training for your trip at least two months prior to your departure. And the best exercise you can do in preparing your mind and body to walk 6 - 7 hours each day, day after day, is to get out and hike mountains or hills in your area. For those who do not have access to trails, but have membership to a gym, you can train very productively on a Stair Master machine. If you have no access to trails or a gym, then try to walk as much as you can, with extended walks on the weekends.
If you've never hiked before, you should start with shorter time intervals, a slower pace, and no weight (in your day pack) and then gradually increase all of the above as your fitness level improves. It is better to increase the time interval/distance and keep a slow pace than to shorten the time interval/distance and increase the pace. Try to train three times a week, for at least one hour per session, at a minimum.
Remember to train in the hiking boots that you plan to trek with so that they are sufficiently broken-in (to prevent blisters). Additionally, you should wear the day pack you intend to carry so you're your shoulders/back/hips get used to the points of contact and weight (to minimize chafing and soreness).
Two weeks before your departure, your training should taper off and in the final days, rest so that your body has time to recover before the trek. In addition to walking/hiking, you can also supplement your training with exercises such as running or cycling, which will increase your aerobic capacity.
Lastly, physical training is just piece of the puzzle when getting into shape. Eat a whole foods based diet loaded with fruits and vegetables and eight hours of sleep per night.