Hair, like finger nails, have a growth region at the base where cells are born and bind tightly together. Newer cells continuously force the old ones outward. These specialized skin cells build up a massive cytoskeleton made of special filaments known as keratin. The cells don't live very long and when they die what is left is the keratin tightly bound together into the fingernail or hair, and this elongates by adding more at the base.
In the drawing the growth region is labeled in red at the base, and you can see the hair shaft, made of the remnants of skin cells, extending upward. If you pluck a hair out you can sometimes see the soft growth region still attached at the base of the hair.