It depends on the type. Treated pine can last 20-30 years. Non treated wood can rot out in 2-3 years. Make sure you do it right the first time by getting the treated wood.
for treated pine timber designed for landscaping 20-30 years is not out of the question before they need replacing - make sure to get the treated timber to ensure longevity.