Fence posts can be joined together directly with lag bolts or indirectly by cutting lumber to run between the two posts. The first method will give your fence a square corner, but the other method will create an angled corner that runs for a foot or two. The latter method might be the touch that adds an extra element of visual design to your fence.
In nearly all situations, a single upright 4 x 4 post will suffice for a fence corner. The exception would be if you are planning to hang an extra wide gate, such as a horse gate. Then you'll probably want to tie two fence posts together with several lag bolts that are at least four inches long.
To do this, make pilot holes that penetrate one post and cut into the second. Cut a starter hole that is larger than the lag bolt's head. Use a speed bore bit to cut this hole, and make sure that the hole is an inch deep so that the lag bolt can't be buried too deep into the first post. Once this larger hole is made, make the pilot hole. Installation of the lag bolt will require a ratchet with a socket that fits the bolt's head.
If your fence posts are separated by a short distance, the best solution is to run two or three pressure-treated 2 x 4s directly between the two posts. This creates a nailing surface so you can connect the two posts with vertical fence boards. Don't worry if your fence corner is not square; it might add a little interest to your fenced-in area.
Cut the 2 x 4s so they are angled at each end to create a tight fit. To do this, have an assistant hold each board in place while you mark the dimension between the two posts. This will give you the overall length. With the board still in place, find the angle between the post and 2 x 4 with a bevel gauge, and transfer the angle to the 2 x 4. Finally, cut the board and nail it in place with galvanised framing nails. Now you have a horizontal surface, where you can attach the fence boards.