You can set a fixed rental duration in the resource settings. However, changing the duration based on the selected price options or fields is not supported. The customer first selects the start and end time. Only after that can they choose price options and additional fields.
Let's create a rental with a fixed duration. Create a resource of type Rental. The templates include a resource with a fixed duration of 3 hours.
Now open the resource parameters. Select the Fixed duration checkbox and specify the number of days, hours, or minutes.
See the demo for a resource with a fixed duration of 5 hours: