Whence has the Catholic Church the right to make laws? The Catholic Church has the right to make laws from Jesus Christ, who said to the apostles, the first bishops of His Church: "Whatever you bind on earth shall be bound also in heaven."
Amen I say to you, whatever you bind on earth shall be bound also in heaven; and whatever you loose on earth shall be loosed also in heaven. (Matthew 18:18)
By whom is this right to make laws exercised? This right to make laws is exercised by the bishops, the successors of the apostles, and especially by the Pope, who as the successor of the chief of the apostles, Saint Peter, has the right to make laws for the Universal Church.
And I say to thee, thou art Peter, and upon this rock I will build my Church, and the gates of hell shall not prevail against it. (Matthew 16:18)
Further reading: CCC 2032-2040