Attack any living creature. Mostly stay put.
If you are playing zombies and skeletons according to the Monster Manual descriptions, there are notes on how they will act.
The Zombies are "mindless soldiers" and will just stand around unless they see any living creature to attack. The description of zombies in the Monster Manual (p. 315) says:
… left without purpose, it attacks any living creature it encounters.
… A zombie retains no vestiges of its former self, its mind devoid of thought and imagination. A zombie left without orders simply stands in place and rots unless something comes along that it can kill.
The Skeletons "aren't mindless" so could wander off, or might echo "habitual behaviours" of their past lives, until they come across any living creature to attack. The description of skeletons in the Monster Manual (p. 272) says:
Independent skeletons … sometimes pantomime actions from their past lives, their bones echoing the rote behaviors of their former living selves. The skeleton of a miner might lift a pick and start chipping away at stone walls. … Left alone in a ballroom, the skeletons of nobles might continue an eternally unfinished dance.
When skeletons encounter living creatures … They attack without mercy and fight until destroyed …
Of course another necromancer might take control of any of these undead creatures while you are gone.
Or, they just wait for you to re-exert control.
I've always read the idle behaviour of Animate Dead creatures as part of the 24 hours of control you are exerting over them, but there is another reading of the spell description (thanks NotArch) which leaves them just waiting and defending themselves when your time runs out. Animate Dead says:
… If you issue no commands, the creature only defends itself against hostile creatures. …
The creature is under your control for 24 hours, after which it stops obeying any command you've given it.
It feels ambiguous enough that the DM can decide if you want high-risk or low-risk animated undead at your table.