Lots of factors involved e.g. how many more assembly processes occur after painting, how long does car lie at the factory after completion, transportation time to another city, how long does car lie at the dealership, etc.
Generally 30 days is taken as a safe time before 'sealing' a new paint through wax, etc. I've personally waxed a new re-paint on a car panel the same day - and it was absolutely ruined.
Also many car care products are labelled 'body shop safe'. That's how you know whether you can use it on a new paint or not.