1) When your monarch dies, there's a good chance (but not a guarantee) that you will stop being excommunicated.
2) When a new pope is elected, there's a small chance that you will stop being excommunicated.
3) You may ask for dispensation; this is a random event that will fire for the Curia Controller that will give them the option to lift the excommunication of your state. You need to be on decent terms with the Papal States and the Curia Controller, and the lower your reputation, the more likely this is to work.
4) If you become Curia Controller, you will have your excommunication lifted quite quickly.
5) If you do the pope a favor (such as giving up a province to him in an event, capturing Rome in a crusade, or defeating the antipope) you will have your excommunication lifted quite quickly.
6) If you convert to Protestant or Reformed, excommunication will cease to matter.