If you are installing a fence with a gate, you will need a latch to keep the gate closed. You can run down to the hardware store and purchase any number of latches, or you can take stock of what you have lying about, and fashion a perfectly functional gate latch from odds and ends.
Bend heavy wire or rebar into a big hook, with a loop at the other end. Attach the loop end to your fence post with a horseshoe nail--one of those U-shaped nails that are pointed at both ends. It should dangle and move freely. Pound another horseshoe nail partially into the gate post, to form an eye for the hook. If your rebar is too thick to fit into an eye made in this way, try drilling a hole in a small block of wood, and attaching this to the gate right where the hook will fall.
Alternately, drive a large screw or nail partially into the post, and let your hook fall onto that to latch the gate.
This latch will take almost no time at all to build, but iy won't be the most durable. It will work best on a gate with vertical posts at the ends that stick up a bit. Scrounge around for a heavy-duty strip of leather. An old belt will work fine. The idea is to make a big leather "U" and nail the ends to each side of the end post of the fence at the top. Slip the "U" over the top of the end post of the gate to hold it closed. For a really minimal latch, cut one strip of leather, and make a slit near one end, big enough to fit over a big nail head. Attach the other end of the strip to the top of the fence end post. Pound a big nail into the top of the gate end post. Push the slit end of the leather strip over the big nail. It's not extremely durable, but it is fast and free.
Farmers have been making wood latches for hundreds of years. Some designs are elaborate, but a basic pivot latch is each to put together. To make a center pivot latch, cut a board about a foot long. Find a really big nail or screw, long enough to go through your board and well into the fence post. Drill a hole through the center of your foot-long board, just big enough for that nail or screw to slide into, while allowing some movement. Attach the board to the end post of your fence. Tighten it so that it can be turned sideways to keep the gate closed, and returned to a vertical position to let the gate open.
The other pivot alternative is to loosely attach one end of a smaller wood piece to the fence end post, and make some kind of pocket on the gate for it to rest in when closed. Carve the pocket from wood, or use an old doorknob or other found object for your pivot latch to rest upon.