How long should I wait before painting new lumber?
In my experience, treated 4x4s will check and twist like crazy over the span of a year as they slowly dry out. So, you're not likely going to get a pristine finish anyways. I'd build the fence, then paint later. If you have the money, I'd swap out the treated posts for cedar.