You want a pulse stretcher...
synchronizer (if required)
edge detector
synchronous set/reset flip-flop, the out_pulse (set on edge detector, clear on terminal count value)
counter (clear when out_pulse is 0, count when out_pulse is 1)
That should do the trick, though if you need to extend the pulse if another input pulse occurs or if you need to "save" input pulses and produce the same number of output pulses, those implementations are left as an exercise for the reader.