Generally, for a better deal it’s recommended to book in a timely manner (to save up to 32%). Cheapflights recommends you book around 30 days prior to your deserved date. Booking as early as you can also increases the likelihood that you’ll get the ideal car.
Typically, how long you can rent a car for depends on the inventory of the supplier. For San Javier however, it is certainly possible to rent a car for an entire month.