When controlling lights by motion sensors on HomeKit the problem is that you can't really change the time duration the lights should be on. Here is a simple example how to adjust the time using shortcuts in Apple HomeKit.

All you need to do is change the repeat value to number of seconds you want your lights to be on.

When the kitchen motion sensor STOPS detecting motion:

--

--