The duration of Animate Dead giving you control is effectively 24 hours beginning from your last casting of the spell.
The regular duration of Animate Dead is instantaneous. This means that (1) you create the undead instantaneously (after the casting time of 1 minute) and (2) the duration of the control effect is 24 hours.
The creature is under your control for 24 hours, after which it stops
obeying any command you've given it
Under normal circumstances you use it to animate undead from a corpse:
This spell creates an undead servant. Choose a pile of bones or a corpse of a Medium or Small humanoid within range.
When you already have undead servants created by this spell it you to assert control over those undead that you created with this spell, as long as you do it before the current 24 hour period (the duration) ends:
To maintain control of the creature for another 24 hours, you must
cast this spell on the creature again before the current 24-hour
period ends.
This requires you to cast the spell again. The new magical control period has a total duration of 24 hours. Since this overlaps with the old control period, it remains in effect for a total of 24 hours after you cast the spell, without combing the duration time of the prior effect since this is the equally potent but most recent effect.
Combining Magical Effects:
The effects of different spells add together while the durations of
those spells overlap. The effects of the same spell cast multiple
times don't combine, however. Instead, the most potent effect — such
as the highest bonus — from those castings applies while their
durations overlap, or the most recent effect applies if the castings
are equally potent and their durations overlap.
If you fail to re-cast the spell once within 24 hours, then the undead you created become an invalid target for the spell. Once you lose control, it is gone; it lasts only 24 hours from the last time you cast the spell.
The duration of Animate Dead giving you control is effectively 24 hours beginning from your last casting of the spell.