In perfect, frictionless situation with perfectly noncompressible liquids or perhaps superfluids this would not be a case, eg length of pipe would not affect velocity.
However real pipes, regardless how smooth, will impart some friction, if only due to intermolecular interaction water/tube material.
In any realistic pipe its length will affect velocity and with growth of pipe diameter departure from expected values will be more and more negligable.
Energywise we have conversion of part of mechanical energy of pump into heat dissipated in walls of pipe and in water.
Overal effect is that with increased length of pipe velocity would drop.
You should also read about laminar and turbulent flow. Former one is something what engineer would struggle for but the later is what he usually get for one or another reason. So the compromise is "as laminar as possible".
Equations are there, you can find them probably via wiki.
Regarding air, yes, length of tube would also matter. Situation there is getting even more complex because air is much more compressible than water is. This is adding "inertia" or time delay to air flow.