Nearly every American school child learns that Halloween was developed as a tradition by the Catholic Church and that it replaced a more ancient Celtic tradition. But the displacement of the older pagan festival required several centuries to occur and the transformation began with the Roman empire, not with the Catholic Church.
Virginia Mescher wrote a fascinating history of Halloween that I found reprinted here. As it so happens, the Church originally designated its "All Saints" feast day for May 13. The Celtic festival of Samhain (pronounced SOW en) did fall on October 31. The Romans moved the festival to November 1 in the year 43 and renamed it Feralia.
Pope Boniface IV (608 to 615) established the Church's All Saints day on May 13. But in 731 Pope Gregory III moved the feast to November 1. The evening before, October 31, then became "All Saints Eve" and the young men of villages went from house to house collecting food for the poor. So the first true Halloween resembling our own annual festival was celebrated in the year 731.
And contrary to the popular belief that the tradition of wearing costumes comes down from Celtic days, it was the French who introduced this practice in the 1300s and 1400s to honor "All Souls Day".
When Protestant churches began forming they abandoned the practice of observing All Saints Day, and thus All Saints Eve. But the Catholics kept up the practice, including the Irish, who provided strong support for the tradition when they began arriving in America. Gradually Protestant communities adopted the practice of dressing up on All Saints Eve and engaging in merry-making and asking for food or treats.
Many of the party games that people celebrated on Halloween were adopted from spells and charms that country folk used to cast on All Hallows Eve. Most of these were harmless love charms designed to foretell matrimonial fortunes and futures.