It is not practical to forecast cash flows for an infinite number of future years. It is usual to end the cashflow used in a DCF with a terminal value as the final year cash flow. This is the value of all cashflows after the final year. A rough estimate suffices because cash flows that are very far off in the future are less important: the the present value of cashflows falls exponentially with the length of time till they are received.
The terminal value may be calculated using a valuation ratio, or by assuming a constant growth rate and using:
PV = CF/(r-g)
where PV is the present value as at the terminal date (it will have to be further discounted in the DCF itself),
CF is the actual final year cash flow,
g is the growth rate after the final year and
r is the discount rate.
Incorporating the above into the DCF formula, it becomes:
PV = CF1/(1+r) + CF2/(1+r)2 + CF3/(1+r)3 + ⋅⋅⋅+ CFn/(1+r)n + CFn/(r-g)(1+r)n
where PV is the present value,
CFi is the cash flow received in year i,
n is the number of years till the last year of the DCF
r and g are as above.
The commonest assumption made for a growth rate used to calculate a terminal value is that it will be the same as long run economic growth.