It means that something cost, or will cost, a high price.
Light-hearted use in the 1940s suggests that it may have indicated the peril in obtaining an item that was much sought after (as in a scramble by buyers for available items). Shortages in the Depression and rationing during World War II make this a likely origin.
Others have suggested it derives naturally from a 19th century expression "if it takes a leg" and the other earlier expression "I'd give my right arm."
Other Explanations for the Idiom1) It is suggested that WWII was the first major war where battlefield medicine was able to save most soldiers who had major trauma to a limb. In earlier wars, soldiers died from these wounds. Improved medical care meant they would survive, but as amputees. While no definite source can be found, these two facts suggest that soldiers who paid a high price in the war lost an arm and/or a leg, and the phrase was born.
(However, surgeons had been amputating severely injured limbs since before the US Civil War, so this explanation may not be completely accurate.)
2) One spurious explanation is that painters would charge more for portraits if they had to spend time detailing limbs, so would charge much more to include arms and legs. This was created in a widely-circulated e-mail.
3) During Apartheid in South Africa, amid the bombings of public places such as fast food stands and restaurants, the phrase sprung up, because the original saying was, "to get something there would cost an arm and a leg." This literally meant that you could lose a limb because it was so dangerous.
Now, however, the phrase has morphed into meaning something is
extremely expensive (i.e. you would have to sell your arm and your
leg to get it). So by saying something costs "an arm and a leg," we
emphasize the price as being ridiculously high. (This is much
later than the first use in the US.)
First off, this is not an idiom. This particular phrase is a metaphor. It's not that old either. It likely came out of the older term, I'd give my right arm..... To depict one's willingness to pay any amount to acquire something. It is likely from the latter stages of the 19th century and wasn't popularized until the 1950's or so. More than likely due to an autobiography on the singer Billie Holiday. Widespread claims that it has anything to do with painting portraits prior to photography is just not supported since it appears no where in print before the 20th century. An arm and a leg is substituted for a large sum of money and since these are unlike things, it is technically a metaphor. A pet peeve of those of us who work in the nuts and bolts of language (see, that's another metaphor) get irritated when people say metaphor when it is actually a simile or acronym when it's an abbreviation or can't correctly recognize an idiom. Of course those who post questions on Answers.com are interested in well researched answers and those of us who have expertise in these areas are more than willing to give well thought out answers rather than populist hearsay. This is a good question and I hope you liked the answer.
A Humorous Source
Adam told god he was lonely, so god said I will create a perfect companion for you who will always look after you, do all the house work, cook all the food, carry your children, look after you when you are sick, love and cherish you always. When you have an argument your companion will always be the first to say sorry because you were right.
That sounds to good to be true said Adam, how much will this cost me god.
And god said an arm and a leg.
so Adam said what can I get for a rib?
And the rest is History.
(see the related question)