Used informally among friends or in casual conversations, not in formal situations. I'd love to stay at that hotel, but it charges the earth!
Pro Tip 2/3
Emphasis on Cost
Emphasizes that something is prohibitively expensive, often frustratingly so. Ever since the restaurant got famous, they've started to charge the earth for a meal.
Pro Tip 3/3
Exaggeration
It's an exaggerated way to say something is very costly, not meant literally. This designer bag costs the earth, but I must have it!