There are painters that guarantee their paint jobs for 20 years - but few homeowners will pay for the prep work that requires. Paint over well-prepped new wood, high quality primer and the recommeded finish coat thickness should yield a life of 15 to 20 years. Paint over poor prep (no power washing or scraping), cheap primer (if any) and a thin finish coat may fail in less than one year. That's quite a range.
Painting older houses is a series of trade-offs. Cost is weighed against desired appearance, proper prep, hassle, lead paint concerns, materials used and durability. Generally speaking, paint on a well-prepped house should last 7 to 10 years. Longer if the underlying paint is in good shape, shorter if you've got problems like excessive interior moisture, leaky gutters or mildew.