Gates are mostly constructed of wood or metal and can be single or double, solid or with spaces in between, be entirely sealed or have a see-thru area, and may be as tall as you wish; gates are not particularly costly items but constructing a gate will still almost certainly cost less than buying one if you are ready for the challenge; so here are a couple instructions to help you construct a gate by yourself if you are a D-I-Yer.
4x4 lumber 4 feet long
1x6 fence boards
1 inch thick strip of wood
Use the 4x4 lumber to make 2 gate posts; with a pick axe dig 2 holes about 2 feet deep and 1 foot wide, place the posts in them and cement them in. For a average garden gate, space the posts around 3 feet apart. This ought to be enough room for you to easily walk through with your garden tools, wheel barrow, groceries, etc.
The gate itself should be no less than inch away from the posts on both sides, therefore if the posts are 3 feet away from each other (36 inches) the gate ought to be 35 inches wide. Assuming that the earth under the gate is even, build a rectangular frame 35 inches wide and around 5 feet long using the 2x3 lumber. Using the saw cut a 5th piece of the 2x3 lumber and set it horizontally in the middle of the 2 long sides of the frame.
Adjust the frame until the 2 diagonal measurements are equal to make sure that the gate is straight and properly squared. Lay another piece of 2x3 lumber diagonally across the frame, cut it using the saw and nail it into place to support the gate.
Nail the 1x6 fence boards onto the frame so that they are equal with the sides of the frame and uniformly extend beyond the top and the bottom of the frame. You may need to cut a piece or 2 in half down the length of it to get it to be flush with the gate frame.
Now it is time to suspend the gate; set the gate between the posts around 2 inches from the ground and with inch on each side and use wedges beneath and to the sides to provisionally keep the gate in position until you attach it to the posts. Screw a t-hinge onto each horizontal piece (the top and bottom boards of the frame and the 3rd piece across the middle) and to one of the gate posts. If the gate opens inward place the hinges on the outside, if it opens out, place the hinges on the outside.
Screw the latch to the center or top of the gate and finally nail the 1 inch thick strip to the gate post to work as a gate stop.
You can build a concrete or wooden bridge right below ground level between the 2 gate posts to keep them from drooping under the weight of the gate. You can alternately construct a header above the gate to avoid drooping.
Cut a hole in the gate close by the latch so that you may quickly reach the latch from the outside of the gate.