Quality gates are created when you are developing your schedule. This is because they are like milestones. Many projects are run in a phase-oriented manner, which would include a checkpoint at the end of a phase to make sure everything is running effectively.
Remember, the cost of quality can be awfully expensive if defects are missed and not fixed; therefore, quality gates are set up to make sure that things are correct before they are too far gone and become more expensive to fix. The quality gates may not even correlate to a project phase that has ended as many companies have specific requirements or even regulations they need to meet and if these checkpoints are not established defects could be missed. These gates do need to be formally scheduled though, and typically a trained inspector would be auditing the quality process and the output...