An HDB flat is not owned outright. It is a 99-year lease from the year its block was completed, and at the end of it the flat returns to the state with nothing paid out. A flat built in 1980 has about 53 years left today.
That matters long before the lease runs out, because the rules tighten as it shortens and each tightening removes a group of possible buyers.
CPF use
You may use CPF in full only if the remaining lease covers the youngest buyer to age 95. Below that, CPF use is pro-rated by how far the lease falls short. Below 20 years, no CPF may be used at all, which means the whole purchase must be found in cash.
Loans
HDB will not grant a loan on a flat with under 20 years left, and banks lend a smaller share as the lease shortens, because the loan must be repaid well inside it.
What it does to the price
Put the two together and a short lease shrinks the pool of buyers to those with cash, which shows up in the price. Compare like with like to see it: within one town, the same size of flat trades for progressively less per square foot as the lease runs down, and the gap widens once it passes below 60 years. Each town page charts its own curve.
When can you sell?
You must live in the flat for the first: 5 years for most flats, and 10 for flats, which also require part of the subsidy back when you sell.
Sources: CPF: using CPF for a property with a shorter lease, HDB: minimum occupation period.