The current Code of Canon Law (1983 ed.), released by Pope John Paul II, has 1,752 canons. The former canon (1917) was the one with over 2,000 canons (2,414, to be precise). These canons are rules related to the governance of the Church, and they are now divided into seven headings: general norms, the people of God, teaching mission of the Church, sanctifying mission of the Church, temporal goods of the Church, penal law, and procedural law.
Many of these laws are subject to change over time as the Church sees fit, while others are not. For example, the discipline of women wearing a veil at Mass was not retained in the newer code, and so the practice is not required. However, others things in the code, such as the doctrine expressed in canon 900 §1 (1983), cannot be changed over time. This canon states the doctrine that only a validly ordained priest can confect the sacrament of the Eucharist.
Like any other social and visible structure, the Church has norms to order the functions that have been entrusted to it. Just as the citizens of the state are to obey the speed limit, and a son is to listen to his mother’s rules, canon law is to be observed by members of the Church—which is both the kingdom and the family of God.
The Church gets her authority from Jesus to make these laws. He told the leaders of his Church, “Whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven" (Mt 16:19, 18:18).
This language of “binding and loosing" was a Jewish phrase that was that meant forbidding and permitting. This pertained to the ability of scribes and Pharisees to establish rules of conduct for the faith community, and the good Jew was called by Christ to obey them (Matt. 23:3).
Since Jesus gave this authority to the leaders of his Church, they have authority to do such things as establish feast days and lay down laws for the good of the community.