This answer from EWTN’s Fr Saunders. Has been edited here for brevity.
Q. Why do priests use incense at Mass? Where does it come from?
The use of incense in the ancient world was common, especially in religious rites where it was used to keep demons away. In Judaism, incense was included in the thanksgiving offerings of oil, rain, fruits, wine (cf. Numbers 7:13-17). The Lord instructed Moses to build a golden altar for the burning of incense (cf. Exodus 30:1-10), which was placed in front of the veil to the entrance of the meeting tent where the ark of the covenant was kept.
We do not know exactly when the use of incense was introduced into our Mass or other liturgical rites. At the time of the early Church, the Jews continued to use incense in their own Temple rituals, so it would be safe to conclude that the Christians would have adapted its usage for their own rituals
The purpose of incensing and the symbolic value of the smoke is that of purification and sanctification. For example, in the Eastern Rites at the beginning of Mass, the altar and sanctuary area were incensed while Psalm 50, the “Miserere,” was chanted invoking the mercy of God. The smoke symbolizes the prayers of the faithful drifting up to heaven: the Psalmist prays, “Let my prayer come like incense before you; the lifting up of my hands, like the evening sacrifice” (Psalm 141). Incense also creates the ambiance of heaven: The Book of Revelation describes the heavenly worship as follows: “Another angel came in holding a censer of gold. He took his place at the altar of incense and was given large amounts of incense to deposit on the altar of gold in front of the throne, together with the prayers of all God’s holy ones. From the angel’s hand, the smoke of the incense went up before God, and with it the prayers of God’s people.”
Q. Why do we use incense at some Mass’s and not at others?
It is optional.
In the General Instruction of the Roman Missal incense may be used during the entrance procession; at the beginning of Mass, to incense the altar; at the procession and proclamation of the Gospel; at the offertory, to incense the offerings, altar, priest and people; and at the elevation of the Sacred Host and chalice of Precious Blood after the consecration. The priest may also incense the Crucifix and the Paschal Candle. During funeral Masses, the priest at the final commendation may incense the coffin, both as a sign of honor to the body of the deceased which became the temple of the Holy Spirit at Baptism and as a sign of the faithful’s prayers for the deceased rising to God.
The usage of incense adds a sense of solemnity and mystery to the Mass. The visual imagery of the smoke and the smell remind us of the transcendence of the Mass which links heaven with earth, and allow us to enter into the presence of God.
Fr. Saunders is president of Notre Dame Institute and associate pastor of Queen of Apostles Parish, both in Alexandria.