Hole depth is determined based upon the frost heave in your area, wind speeds, wall size, building dead load and other factors.
Northern climates frost heave is often 36" to 42" and post embedment is typically 4'.
Uplift Cleats
Uplift is a big concern for pavilion structures and those with open walls. Even if your building will be fully enclosed nail some uplift cleats to the post with 4" nails.
Use treated wood and nail them to the bottom of the post at the footer.
Corner Posts
Place footer in hole. Make sure everything is level and set post in hole. If your post is a 4x6 the wide part of the post goes perpendicular with the wall (4" parallel with wall / 6" running the other way).
Leave room for the girts by placing the post 1 1/2" inside where the mason lines meet at the building corner (unless you are doing
bookshelf girts).

While continuing to check for plumbness nail a temporary brace from the inside of the corner post (at the top) and secure to the ground near the stakes. Do the same thing in the opposite direction too.
Fill hole with dirt or dirt/gravel mix, and tamp solid.
Repeat for all corner posts.
Sidewall and End Wall (Gable) Posts
Repeat the above steps for each post between the corner posts, bracing and plumbing up as you go. Post spacing is determined by referencing your structural building plans.
Setting Pole Barn Posts (Full Height Gable Posts)
Full Height Gable Posts Nailed to Top Chord Of End frame Trusses