Yoga pants are made out of a slightly thicker material. They often come with fold-over waist bands and they come in skinny and bootcut/flare cut. Leggings are made out of a slightly thinner material and only come in a skinny cut.
Yoga pants are looser, and I think they look a little less formal, but it depends on how the person is wearing them. leggings are more tightly fitted.