What length of posts do I need to get a deck 5 feet above ground level?
You should use concrete footers in concrete form tubes buried in the ground deep enough to meet the code in your area. ( below frost line ). You need to use the apropriate size for your soil and the weight of the deck you are building. The concrete footer would extend  above the ground by a few inches, you would then use a Simpson post bracket anchored into the concrete to set your post on/in. This keeps the bottom of the post from sitting in any water that may accumulate on the top of the footer.  

The height of the post will be the distance from the top of the bracket on the concrete footer to the bottom of the beam that caries the deck joists. You will need the determine that length once you you have the footers in place and you have the height of the deck joist and the dimensions of the beam you are using.