You can do it by using a little trigonometry (standing a known distance away, find the angle to the top, then calculate the height of the tree), but that's not always the simplest way.
A quick and dirty method I've used is to strap a board of known length to the tree, then take a picture that encompasses the whole tree from a ways away. Print out the picture on paper, measure the length of the board in the picture as well as the length of the tree. Since you know the length of the board in real life, you can find the ratio of the real length to the picture length, then apply that to the picture length of the tree and get the "real" height. This method has some inaccuracies, but generally should get you within a few feet. The longer the board is, the less error, and generally the further you are from the tree the less error there is (compensates better for lens distortion).