From a coach/racer stand point here's what I do and generally recommend for my clients:

Anything over 1 hour you need some caloric and/or electrolyte replacement. How many calories you take in depends on intensity of exercise and you body size but for moderate intensity most of my clients do well will 100 to 150 cal per hour. If your caloric replacement drink or food has electrolytes, great. If not you should be adding electrolytes too. Sometimes you don't need them but the risk of not getting enough electrolyte far outweighs the cost of not having enough. It's not really a problem for shorter rides etc but in endurance sport we are seeing a higher incidence of hyponatremia. This article link is actually quite good and explains it well.

What do I do? I use endurolytes at a rate of one per hour for any rides greater than 2 hours regardless of temp. I use up to 2 or 3 per hour for long, hot endurance events. This is in addition to Perpetuem mixed with some Heed. But I live in a hot area, often ride more than 4 hours at a time and am a salty sweater. And, I don't have any health issues where I would be concerned about getting too much sodium.

Hope that helps.