What is the formula for fence height and fence post length?
Are you setting the posts in the ground, or in concrete? How deep is the frost line in your area? Have you contacted your local building department? There may be local codes and ordinances that stipulate the depth.  

A common rule of thumb, is to dig the hole 3 times as large as the post, and to a depth of 1/3-1/2 of the post height above ground. so for a 8' high fence, using 4x4 posts. dig the holes 12" in diameter, to a depth of 2 1/2 - 4'. Of course, that's assuming you're setting the posts in concrete. 

If you're going to put gravel at the bottom of the hole, you'll have to dig the hole that much deeper. Gravel is optional, and dependent on the drainage characteristics of the local soil.