In APA, encyclicals and other Church documents are cited according to the type of publication. Use the APA instructions in the Referencing guide for Books if the encyclical is a stand-alone publication or the section for Web Resources if the document is found online (see links below).
The author of a papal document is the name of the pope but do not use the title "Pope" before the name.
Here is an example of a printed Gaudium et Spes:
Paul VI. (1965). Pastoral Constitution on the Church in the modern world: Gaudium et spes. Boston, MA: Pauline Books & Media
Here is an example of a Gaudium et Spes found online:
Paul VI. (1965). Pastoral Constitution on the Church in the modern world: Gaudium et spes. Retrieved from http://www.vatican.va/archive/hist_councils/ii_vatican_council/documents/vat-ii_const_19651207_gaudium-et-spes_en.html
In-text references for the above reference list examples would look like this: