The "Twelve days of Christmas" are the 12 days that separate Christmas day, December 25, from Epiphany, which is celebrated on January 6. Depending on the church, January 6 may mark Christ's baptism (the Catholic tradition), or it may mark the day that the wise men visited the baby Jesus with their gifts.
In the past, there was a tradition of giving gifts throughout the 12 days, rather than stacking them all up on the morning of December 25. That tradition, as you might imagine, has never really caught on in America.
This explanation offers some interesting perspectives on the 12 days of Christmas and the song that has that title. And this page contains a thesis-full of information!
For a complete look at Christmas, including the origins of all sorts of wacky Christmas traditions from mistletoe to Rudolf, see How Christmas Works!
Here are some interesting links: