Some flights may make you take a layover in another city before you get to your destination. Direct flights are probably ideal but I know they can also be more expensive. On the bright side, it can be nice to have a meal and stretch break in the middle of a long flight, and gives you an opportunity to explore the airport or city (if you have more time).
General rule of thumb: anything under 6 hours, you want to fly direct.
If you do have to take a layover, consider the transfer time. I say give yourself at least one hour of wait time in case your first flight is delayed, you need to get something figured out, you need to buy some water and food, etc. Things come up and because boarding happens generally thirty minutes prior to takeoff, better safe than sorry. I would actually go and say an hour and a half is good. I try to find layovers around 2 hours which gives me plenty of time to use the restroom, grab a quick bite, freshen up, walk around the airport, and find my transfer gate if it's at a different gate, which brings me to my next point.
If your layover is longer than 3.5 hours, consider going outside and exploring if the city centre isn't too far from the airport, especially if your luggage will meet you at the final destination! Do consider the time it'll take you to come back and get back in the security line though.
Depending on the flight, your transfer flight might be on the same plane and same gate, or different plane in a different gate. Be attentive to what your flight details read, and what your flight attendants say during landing. If it's a huge airport, it might even be in another terminal so always allow yourself extra time should things come up and you're not scrambling last minute to find your next flight.
If you can help it, avoid flights with more than 1 layover. You're going to be exhausted and that may cost you some of your trip. Remember: we want to maximise your time and enjoyment on your travels!
My piece of advice: DON'T DO IT.
Call me high maintenance, but I can't sleep comfortably at all on overnight layovers. It's cold, the chairs are stiff, you're constantly worried if someone might steal your stuff, some airports don't allow you to sleep so you have security waking you up every couple of hours, and people coming in and out of the gates. You barely get enough sleep by the time you need to line up for your flight and if you're anything like me, you end up grouchy and groggy, and you only see the negative in things until you recoup some of that sleep. It's just an overall highly undesired experience, which will likely affect your first day traveling.
If you have an overnight layover, this site will give you the 411 on WiFi, where you can sleep, and other good tips on specific airports..
If you MUST do an overnight layover, I really recommend reserving a room at a hotel with free shuttles that will take you to the hotel in case taxi service is out (if you arrive really late). At least you'll get some sleep in a private, semi-comfortable bed. If not, this page has good tips on sleeping at the airport overnight.
My logic: Most likely, the cost of a hotel will be around the much you'd be saving if you don't take the overnight layover, so just get tickets with a short transfer and be happy. (: