Did you tie a knot at the end?
If by hand, tie a knot.
If by machine, be sure you leave enough thread through the needle.
Tension is set too high on the sewing machine.
If you're sewing with a machine then Korvo is correct, the tension is to high on the machine. Back the tension down, a little at a time, until the thread stays put!