Sections plus one
Post counting trips people up because the intuitive answer is off by one. If you have five fence panels in a straight line, you need six posts — one at each end of the run plus the four shared between panels.
So the rule is: work out the sections, then add one post.
A worked run
Take 120 ft of fence with a single 4 ft gate, posts at 8 ft spacing.
The gate takes up 4 ft that does not need fencing, so the fenced length is 116 ft.
116 ÷ 8 = 14.5, which rounds up to 15 sections. The last one is short, and that is normal — you trim it rather than leaving a gap.
15 sections means 16 posts. Then add the extras: two corner or end posts and one extra post for the gate, which needs a post on both sides. That gives 19 posts.
Rails and pickets follow from the sections
Most fences use three rails per section — top, middle and bottom. At 15 sections that is 45 rails, or 360 linear feet of rail material.
Pickets depend on width and spacing. For 5.5 inch pickets butted tight across 116 ft, you need about 254, and it is worth ordering around 272 to allow for warped or split boards in the stack.
Depth, and why you buy taller posts than the fence
The standard guidance is to bury a third of the post's above-ground height, or go below the frost line, whichever is deeper. For a 6 ft fence that means about 2 ft in the ground — so you buy 8 ft posts and only 6 ft of each shows.
In cold climates the frost line rules. If it sits at 42 inches where you live, a 2 ft hole will heave the post out of plumb after the first hard winter, no matter how much concrete is in it.
Concrete adds up faster than expected
A 10 inch hole 30 inches deep takes roughly 1.1 cubic feet of concrete. An 80 lb bag of mix yields about 0.6 cubic feet, so that is close to two bags per post. At 19 posts you are looking at roughly 35 bags — about 1.4 tons of material, which is worth knowing before you decide how many trips the car is making.
Check the line before you dig
Mark every post position along the whole run and stand back before the first hole goes in. Corners and gate posts are the ones that have to be right, because everything else spaces off them. A post set 4 inches out of line is a five-minute fix before the concrete goes in and a weekend afterwards.