Simon Gawesworth explains various leader lengths for various lines in his new book, great coverage of this and all topics Spey (a must read).
My own experience is that leader length affects anchor and fishing presentation which includes turnover of the fly and stealth factor. I find that my anchor (grip/stick) is easier to manage with a longer leader in floating line situations and generally easier with a shorter leader in sinking tip (sinking line / intermediate full) situations with a heavier fly.
With floating lines, I am always trying to keep the d-loop up and big so the cast can cut wind or it's own drag in the air. A plastic string full of tiny air bubbles needs that to get a good surge of energy going. I find a long leader helps manage that like a tail on a kite. Besides, you want the fly to have some separation from the nail knot and drag of the line when skating, or a wet fly to ride as deep as possible - so a long leader is handy.
Sinking lines are high density impregnated with tungsten and whip about without a tail, but put too much gap between the tip and the heavy iron fly and the anchor will hinge. Besides, you want the fly to ride deep so it should be close to the tip.
So rule of thumb; fish long when dry & short when sunk. Adjust the length to suit your own casting stroke and preferences for fishing.
I'd definitely Read Simon's guidelines for specific recommendations.