In Qatar, six months, because IDP can be used only if your visa is a tourist/visit visa and maximum extension for a visit visa is six months.

Before using IDP, check with the car insurance company too. They may restrict you to use only a rented car, so if for example you borrow your friend's car and get into an accident the insurance company may reject the claim.