There is no rule in this, it depends all on how often is the carpet used, the traffic on it, and its location, for example, a carpet in a children's room is not the same as in your own bedroom when it comes to the traffic or stains that occurs on it.
But in general and for normal use and traffic on your carpet, think of it as making an appointment with the dentist, if you don’t treat problems instantly you may end up with serious issues, permanent stains, bad smell, discolouration and damage.
Regular home carpet maintenance would ideally be every four (4) to five (5) months here in the UAE, considering the dust and humidity and indoors conditions. If carpets get a nasty stain of food, wine or any beverage, it is recommended to seek professional help and advice immediately, especially for wool, or expensive carpets such as silk, the more the stain remains on the carpet the more it becomes permanent.