Protect your fence from the elements by treating it regularly and it should last you a long time.
There are a range of options which all broadly do the same thing. The most common are water-based and solvent based solutions.
Preparation
All surfaces need to be dry and clean from dirt.
Before treating a fence any wood that has been stained or painted needs to be taken back to the bare wood.
Lichen, algae and fungii need to be removed with an appropriate fungicide.
Cover any surfaces that are not to be painted. Concrete is very easily permanently stained by some preservatives.
Fencing treatments are extremely harmful to aquatic life and working with treatments near ponds and rivers should be avoided.
Treatment
Only treat the fence in dry conditions. Check the weather report to avoid bad weather.
Do not paint a fence in cold temperatures as coverage and adhesion is affected in near zero temperatures.
Try a test area before painting the whole fence.
If using multiple cans try and mix them together in a larger container to ensure consistent colouring of the fence.
After treatment with preservatives extra protection can be added by giving the timber a coat with wood oil. This helps the panel from reducing the amount of water that can penetrate reducing rotting and moulds.