Generally, for a better deal it’s recommended to book in a timely manner (to save up to 2%). Cheapflights recommends you book around 37 days prior to your deserved date. Booking as early as you can also increases the likelihood that you’ll get the ideal car.
The length of time you can book a rental for is subject to the inventory of the supplier. When renting a vehicle from Nelson Mandela International it should be possible to rent a car for a whole month if needed.