You would typically use PVC cement and joints. Buy the cement two pack that includes the purple primer. First apply the primer to the pipe end. Let it dry (like 10 seconds?). Add a ring around the outside (on top of the primer coat) and slide the joint over the cemented end. If it sounds difficult, don't worry because it's not. There are probably a thousand videos online for using the stuff. Make sure to follow the instructions, and DO IT OUTSIDE. Otherwise your wife will probably kick you in a delicate area.
The cement actually heats up the pipe, melts it, and fuses it together. It makes it 100% waterproof, and PERMANENT. So if you make a measurement mistake........yep, you'll be cutting pipe. I'd also invest in a PVC pipe cutter or a hacksaw.
It seems like common sense, but some people don't think straight after digging all morning. DON'T BURY THE PIPE until after you test the system for functionality and leaks. Some lessons are learned the hard way.