This question came to my mind when I read on NASA's website that an explosion (gamma ray burst, GRB 080913) took place 12.8 billion light years away from us. How do they measure such large distances?
Did you mean 12.8 billion light years away?
If so, in this case the distance was estimated by measuring a rough spectrum for the GRB. The NASA article I've linked says:
In certain colors, the brightness of a distant object shows a characteristic drop caused by intervening gas clouds. The farther away the object is, the longer the wavelength where this fade-out begins.
This technique is used where it's hard to get a detailed spectrum and calculate the red shift.
If you're asking a more general question then this is covered in the question How is distance measured to far away stars and galaxies? and your question would be a duplicate.
For relatively close objects, the distance can be measured through measurements of parallax (http://en.wikipedia.org/wiki/Parallax ).