Terminal posts will be 2 inches taller than the line posts, which are the same height as the fence. They will have terminal post caps on them and be set in a 6-to 8-inch diameter hole. The Lowe's website notes that the hole's exact depth and diameter will depend on the weather conditions, for example making sure the posts go below the frost line.
Gates posts typically go a little deeper to allow for the stress of the swinging gate. Add an extra 6 inches to the depth of the terminal post holes, making 64 inches for the 42-inch fence.
The Lowe's website notes the line post height above ground will equal the height of the chain-link fabric minus 2 inches. Given that the fabric is 3 feet 6 inches, or 42 inches, the line post will be 40 inches above ground, and 13 (one-third) inches below.
The Lowe's website recommends 30-inch holes for the terminal posts and 18- to 24-inch holes for line posts. That would set the post sizes for a 42-inch fence at 72 inches for terminal posts and between 48 and 54 inches for line posts.
The Hoover Fence Co. website recommends marking terminal and gate posts at the height of the fence plus 1 inch, for example, at 43 inches for a 42-inch fence. Hoover recommends marking line posts at 3 inches less than the height of the fence, in this case 39 inches. Adding the top rail and post caps will adjust the height. The marks represent the bottom of the fence and allow you to put posts in to the correct depth, taking into account the slope of the land.