w is the limiting age for the population. We assume that everyone dies before age w and l_w = 0 (ie no one is alive at age w, and indeed at any age higher than w).
So, if someone is aged 116, and w = 120, then 3_p_116 (the probability of surviving from age 116 for 3 years to age 119) is non-zero, but 4_p_116 (the probability of surviving from age 116 for 4 years to age 120) is zero.
Hence, in general, t_p_x will be non-zero for values of t up to and including w-x-1, but 0 for values of t above w-x-1.
So it doesn't matter if the summation goes beyond w-x-1 to infinity, as we're just adding on lots of zeroes.