Does an ÜberCharge last longer if the patient is taking damage?

The duration of an ÜberCharge is always 8 seconds when you keep a single patient; the only thing affected by a patient's health status during an ÜberCharge is healing, which is a separate matter from ÜberCharge.

The only thing that shortens the duration of the ÜberCharge itself (for the Medic), and not the filling of the charge meter, is passing the healing beam to multiple patients such that more than one person receives invulnerability.


For a condenced answer spesific to this question:

Übercharge-meter doesn't gain any charge while its being used.

For more exhaustive answer, see The Annoying Pyro's answer.