There are so many factors to answer this question... There are good posts in this thread so let me just summarize by saying:
There is no "right" time to wage war...
You need to evaluate several factors, whether you are playing humans or AI...
1) Who has the current advantage?
2) If it is you, will your lead GROW or shrink by waiting? If it isn't, how much chance do you have to narrow the gap or take the lead?
3) How much will every civ NOT involved in the war benefit from you and your potential enemy fighting and wasting resources?
All that said, I'd say look at a couple more factors:
4) PROXIMITY... the further away, the later you should wait to fight...
5) WONDERS... feel free to disagree but there are a few wonders that affect my timing...
LEO'S: If you have it, WAIT... your opponent has to waste resources keeping up with your automatic unit promotions... If your opp has it, try to take it, and if you can't, try to get Sun Tzu's and keep him focused on war
GREAT WALL: If you have it, ATTACK... Any cities you take will have undestroyable city walls... If your opponent has it, try to go science if you can and go straight to metallurgy to defeat the GW... Usually anyone with GW won't have city walls and will be caught with their "pants down" when metallurgy is discovered....
HAPPINESS WONDERS: The more you have, the longer you should wait, since you can develop faster than your opponent, especially if you can stick with a peaceable science government like republic or monarchy
STATUE OF LIBERTY: If you have it, early fundamentalism is a good way to wipe out your opponent... I usually use it to go demo "We Love" days, build up my city sizes, then go right to fundy and MASS PRODUCE.
LIGHTHOUSE/MAGELLAN'S: Although attacking is easier if you have them and youre on different continents, they can also be used as defense... if your enemy can't land on your continents due to your naval superiority, if you can keep boats in the water and happiness under control, you can out-SCIENCE your opponent without worry of war or tech theft.
What else am I leaving out/who agrees or disagrees?