This is definitely a frequently asked question and to a large extent the answer is a matter of opinion. Also, it depends on what kind of wood you have. As a general rule:
Pressure Treated Fences
For pressure treated wood we recommend staining immediately after installation. It’s a layer of protection before any cracks or imperfections begin to show. And you can always go back and cover problem spots if they develop.
For cedar we recommend waiting for about a month after installation until the wood has dried. It takes a few weeks for cedar to settle into its “natural” state and that’s the best time, in our experience, to stain the fence.
Regardless of when you stain, try it out on a small spot first. Wood is unpredictable and stain colors can appear different than what you see on the label. See the results for yourself before you commit to the entire fence.
Where can I get stain?
You can buy stain at any of the big box outlets like Lowe’s or Home Depot. They’ll typically have specific directions for cleaning and prepping your wood beforehand. Make sure to follow them to ensure the best results.