Momentum of a system is only conserved when
When the momentum of the system before impact is the same as that after impact.Hence the momentum of the system is conserved.