The treeline or timberline, the line on mountains and in polar regions beyond which trees will not grow, is mostly determined by temperature.
Trees need a long enough and warm enough summer to ripen seeds, produce new wood and form buds.
However, temperature is not the only factor, and the altitude above sea level is not the only thing that determines how cold it gets.
For example, the mountain timberline would always be higher near the equator than it is near the poles if it were not for the abundant rainfall in the equatorial mountain regions, which lowers temperature.
The seasonal distribution of rainfall is a factor at all latitudes, as is drainage.
Local snow distribution is also involved. The area must be clear enough of snow for long enough to allow seeds to germinate and seedlings to become established.
High winds tend to stunt woody plants, creating a “shrubline,” particularly in tropical mountains.
Other factors determining tropical tree lines are incompletely understood.