I'm still trying to track down the absolute authoritative answer for this odd question. Why twelve?
One thing is certain: both the Egyptians and Babylonians were measuring their days with sundials and dividing day and night into twelve hours each. So they're to blame. But why? Why not ten?
What's Your Sign?
The more prosaic theory is astronomical, and I have a strong suspicion it's the right one. The Zodiac-- the belt across the night sky through which all the planets and moon pass, and if you know your sky well you realize the sun passes through it too -- has twelve constellations. The Egyptians, Babylonians, and other folks in that part of the world didn't always agree on exactly which constellations were which (Leo was in there all the way back, at least), but they were pretty sure they saw twelve sets of stars.
I recall a bull-harp from the Royal Tombs of Ur (c. 2500-2600 BCE, roughly the same time as the Egyptians were putting up pyramids) that had Scorpio on it. Sort of. Their Scorpio was a little more anthropomorphized than ours; he had a smiling face and big eyes like most Sumerian guys (at least in their artwork). You can see him and his friends in the UPenn Museum where I used to poke about as a kid.
Anyway, Scorpio's ooooold. It's a slim bit of evidence, but it suggests -- at least suggests -- that the twelve-constellation Zodiac may already have been kicking around that far back. In which case, the twelve hours are just the twelve stations of the Zodiac. That makes fairly good sense, except that the sun passes through only twelve stations in 24 hours. But a six-hour clock wouldn't have enough divisions on it to make a good chronometer.
Thirty Days Has September... Wait, What Month Is That Again?
A variant of the astronomical approach is to point out that there's usually twelve moons in a year. Twelve months, twelve moons: obviously twelve is the magic number when it comes to time. Or is it? Our twelve-month calendar didn't actually kick into gear until Augustus thought it would be clever to add months named for himself and his step-dad Julius to the ten-month calendar. Unfortunately that scooted 7ber, 8ber, 9ber and 10ber ahead two months (that's what septem, octo, novem and decem mean in Latin), so some month names don't make much sense anymore.
There were ten month, twelve month, and the occasional blue moon thirteen month calendars kicking around, so twelve's supremacy over ten is a little less of a given if you use the calendar argument.
I Have Twelve Fingers! Sort Of.
This is the explanation I've come across that I don't think is true, because it sounds like the same reasoning that made me guess (at age 10) that poetry was named after Edgar Allan Poe, but golly gee, I'd like to hear of some textual evidence for this idea in old cuneiform, because it's CUTE!
Hold up your hand. Yeah, take it off the mouse and keyboard-- it's possible. Now take your thumb and touch it to the first segment of your pointer finger, the part between the fingernail and the joint. That's one. Scoot down a segment. That's two.
Keep counting. Three segments on each finger, four fingers (since you're counting using the thumb) -- twelve!
Now, to tell someone on the other side of the cafeteria what time you're going to meet her, assuming she knows how to count Babylonian style (Babylon was a successor to Sumer; there were a lot of old civilizations in Iraq whose ruins were very interesting to study before we bombed them to smithereens) -- er, excuse me -- anyway, teach a friend to count by twelves, and you've now got a sign language appointment book. Left hand = hour hand, right hand = minute hand, or if need be, AM and PM.
The Sumerians and Babylonians were hooked on the numbers 3, 4, and 12, and they did math with base 12, so there is at least some slim evidence to suggest the 4 fingers, 3 segments thesis is in fact the right one.
Totally useless to know, but it might make for an interesting party trick -- "Can you count to twelve on your hands without repeating any fingers?"