Welcome!
Check the "captivity_wilderness_taken_prisoner" menu in module_game_menus. The time of being captive is pseudo randomized there via this operation:
Python:
(store_random_in_range, ":random_hours", 18, 30),
Adjust these numers above as you need but remember that it's upper range -1 (so it's 18-29 in reality by default).