A turbo by itself does not know how to regulate boost levels. Basically, a turbo system is a positive feedback loop meaning that the engine's exhaust spins the turbo which, forces more air into the intake making more exhaust which, in turn spins the turbo even faster. Without a way to regulate boost levels the turbo would keep producing higher pressures until the engine exploded. This is where the wastegate comes into play. The wastegate attaches onto the turbo header before the turbo. When you begin accelerating exhaust gas pressure builds inside the manifold and is forced through the turbo. This pressure continues to increase as the turbo spins faster (remember the positive feedback loop). When the desired boost level is reached the wastegate opens and vents pressure from inside the manifold so the turbo won't spin any faster.
Inside the wastegate is a diaphragm which creates a seal, and a spring which holds the wastegate closed. Spring rates vary depending on the amount of boost you want to run, typically they are given in a "bar" value for example 1 bar would be 14.7psi. This would mean that in order to open the wastegate you would need to excerpt a greater pressure than the 14.7psi spring holding the wastegate closed. In order for the wastegate to work you must have the compressor reference port hooked up to the compressor side of the turbo, if you don't have this vacuum line attached than the boost pressure will not be limited to the set spring pressure; it will build unlimited boost pressure until your engine is destroyed.
Normally pressure from a spooling turbo pushes against the diaphragm (though the vacuum line attached to the compressor reference port) which in turn pushes against the wastegate spring. When the pressure from the spooling turbo exceeds the spring pressure the wastegate's plunger opens releasing the excess pressure through the dump tube into the exhaust after the turbo or to open atmosphere. Typically, if you use the wastegate to control your boost levels you will experience a decrease in power and spool times. Why? Although the spring fully opens at its set spring pressure it tends to begin opening before reaching the set spring pressure. This "pre-opening" leaks boost pressure through the dump tube before max boost pressure is reached resulting in a decrease in power mostly toward the top end. This can be corrected by using a boost controller.