Uniform or non-uniform
In uniform circular motion the speed stays the same, as on the earlier slides. Here the ball moves freely under gravity, so it slows as it climbs and speeds up as it falls: \(v_\mathrm{top}\) is less than \(v_\mathrm{bottom}\). The equations on the slide still hold at the top and at the bottom, each with the speed the ball has there.
Building each equation
In both places, take “towards the center” as positive and add up the real forces. At the top the center is below the ball, so tension and weight both point towards it. At the bottom the center is above, so the tension points towards it and the weight away. The resultant towards the center must equal \(\frac{mv^{2}}{r}\).
The slowest it can go over the top
As the speed at the top is reduced, less force is needed and the tension falls. A string cannot push, so the least possible tension is zero. Then the weight alone is the centripetal force: \(mg = \frac{mv^{2}}{r}\), so \(v = \sqrt{gr}\). Any slower and the string goes slack before the top.
Only the top and the bottom are examined. At other points the weight has a component along the path as well, which is what changes the speed.
The same two equations describe a car on a hump-backed bridge or a rider on a loop: replace the tension by the normal force, with its direction.