To tell you the truth, any time during the day is perfect for taking photos.
But, I'm sure you'll hear that early morning and late afternoon are the best times. I agree that these are fantastic hours as the sun is low and emits a golden hue to everything it touches.
This means that you often get a great highlight or rim light around your subject which helps create dimension and a vibrant color range.
This works well when shooting portraits and when shooting landscapes.
But, don't be fooled into thinking that is the best and only time to take photos.
Often times cloudy days create a perfect time to take portraits as the clouds act as a diffuser to the sun, which in turn created soft and even lighting.
This is fantastic as you will almost be able to place your subject anywhere without having to worry about them squinting or having heavy shadows on their face.
And, even on a very sunny day you can get some magnificent photos. Try to keep your subject near the edge of shade where they are facing in the direction of the sunlight and you will find that "natural reflectors" work great!
Lighting is king when taking photos and finding the right light in any occasion is what makes things both challenging and fun.
So the next time you see it really overcast or super sunny out don't cancel that photo session, work with it and see what you can do.
Being able to manage light and use it as best as possible will increase your overall skill as a photographer and teach you a lot more than shooting in mostly ideal situations.
Feel free to comment!