There are a few answers to this, there isn't really 1 right answer.
Morning excersise: by exercising in the morning you kick start your metabolism, you should eat a very small amount before to give you that boost, but always eat your breakfast after, so your body gets used to knowing its going to get fuel after and it will allow its self to burn up more energy.
Afternoon/evening exercise: aside from revamping your metabolism, to keep the fat burning process going over night. For a lot of people exercise in the afternoon or evening gives you a spike of energy that comes with the feel good pheramone, exercise releases. But your energy then drops relaxing you and preparing you for a more restful nights sleep.
Exercise before or after eating: there is a few answers fo this and it all depends on what you want to achieve with your body. For fat loss, always eat after, by doing this your body learns that its going to get fuel after so it allows itself to burn more fat. For bulking up, or maintainin your weight its both, you need to eat a small amount before exercise, so that your not burning the weight you already have, then also after to refuel, its also what your eating so obviously you wouldn't eat a pizza, you should be having proteins from meats birds and fish and carbs from veggies, if your trying to bulk up, also have slow release proteins, like chicken breast, tuna and even cottage cheese, is great, hav them before bed and they will slowly release and feed your muscles over night.
So as you can see there isn't one right answer. In the end it comes down to what your wanting to achieve with your body,how much time your willing to spend on exercise, and what fits in best with your schedual.