Gate Post Size
Gate posts need to be cut so they are three feet longer than the height of the fence. Cut the fence post to length with a miter saw. Three extra feet will ensure that the post sinks into the ground deep enough that it will not dislodge easily over time. Keep in mind that the gate will also hang directly off of the gate posts, so they need to be tough.
Dig the Post Hole(s)
The gate post is three feet longer than the amount of the post that will be left exposed. So the holes must be three feet deep. The hole should also be about 6 inches wider than the width of the gate post. So if you use a square post that is 3 and 1/2 inches wide, the post hole should be 9 and 1/2 inches wide.
Setting the Gate Post(s)
Dump three to four inches of gravel into the bottom of each post hole for drainage (so the wood will not rot in the hole over time) and place one end of the gate post in the post hole on the gravel. Use 2 by 4s and a hand level to set the gate post to plumb. Add a couple 80-pound bags of concrete to a wheel barrow of cement mixer and add water to the mixture slowly. Mix the concrete with the water so it is not crumbly and not runny. If you add too much water to the cement mix, it will never set right. Dump the mixed concrete into the hole. While the concrete is still wet, make sure the post is still plumb making any adjustments to the 2 by 4s that are required. Poke a long, thin piece of wood into the concrete to remove air bubbles. Form the concrete so it is not level to allow rainwater and snow to run off and not pool around the post while the concrete sets.
When the concrete is mostly, but not completely dry, form more concrete over the setting concrete around the bottom of the gate post into a slight dome so there will be no chance for water to pool around the post. Also, this will allow rain and snow to run away from the post as well. Water is the enemy of fence posts--even if you use treated wood. Keeping water away from the wood will help the post last longer.