It comes from starting with the birth of Jesus as a beginning point. They then add up the ages of the characters given in the bible as most characters lineage and ages are given. They then move backward from Year 0 (or 1BC /Ad if you prefer), add that to our current year in the 2000s and you end up with between 6000 and 10,000 years.
The discrepency is because there are some gaps and so "educated" gusess have been made.
Some even have a specific date! Sunday, 23 October 4004 BC
The calculation was done by Bishop Ussher, Archbishop of Armagh, in 1658. By working backwards through the genealogy in the Bible, and correlating that with then known world events, he came of with a date for creation. This was Sunday, 23rd October, 4004 BC.
This date was later updated by Sir <something> Lightfoot, which actually gave a time for 9AM.