In my experience, it is when you come home, before the sitter leaves. At that moment you know how long they babysat for and how much extra you owe them for being late (I used to charge double after midnight and double if you're late, so possibly 4x for that last hour.) Bring the right amount of cash home with you if you can, or email them the money while you're all still there. Then the sitter can leave or you can take them home.
There's no real reason to pay them in advance - they can't use the money while they're busy watching your kids - but every reason not to make them wait. If you can arrange to go out and get a sitter, you can arrange a way to pay electronically the moment you get home.