Order of precedence in the Catholic Church

Precedence signifies the right to enjoy a prerogative of honor before other persons; for example, to have the most distinguished place in a procession, a ceremony, or an assembly, to have the right to express an opinion, cast a vote, or append a signature before others, to perform the most honorable offices.
The order of precedence in the Catholic Church is organized by rank within the hierarchy according first to order, then jurisdiction, and finally to titular or "ad personam" honors granted to individuals despite a lack of jurisdiction. Emeritus ecclesiastics are counted among the latter. 
Precedence may also apply to feasts or actions, as for example in the order of precedence of liturgical days. 
Sources.
At this time, a current table of precedence in its entirety is not published by the Holy See. However, the principles of precedence present in the "Codes of Canon Law", and the customs of precedence longstanding, inform any formulation of an order of precedence. Some contemporary authors have compiled reference texts complete with a table of precedence based on such principles, and these, though helpful, remain unofficial in nature.
Though the 1911 Catholic Encyclopedia offered a brief order of precedence based on these principles, it was updated and replaced by the New Catholic Encyclopedia in 1967, which was further updated with a "Revised Edition" in 2002. The current "Catholic Encyclopedia" does not include an entry on "precedence". Since the publication of the first edition, in 1911, several changes have rendered its order of precedence substantially out of date, including the publication of three codes of canon law (1917, 1983, 1990), an ecumenical council (1962-65), and multiple apostolic constitutions that affect the topic.
Principles and customs.
As noted above, the first consideration for precedence is always the hierarchy of order: first bishops, then presbyters, next deacons. At earlier times in the Church's history, deacons were ranked above presbyters, or the two orders considered equal, but the bishop always came first. Laity (including lay ecclesial ministers, religious, seminarians, et al.) are not part of the hierarchy of order. 
The next principle is the hierarchy of jurisdiction: one who has authority over other persons has the right of precedence over them. This considers a person's office, and therefore can include laity, particularly lay ecclesial ministers and religious. 
Relatedly, those with jurisdiction take precedence over those with titular, "ad personam", or emeritus titles, so someone serving in a specific office (e.g., diocesan bishop) has precedence over someone with a titular claim to the same rank (e.g., titular bishop) or someone who used to serve in an equivalent office (e.g., a retired bishop). 
Generally speaking, function, or the exercise of office, has precedence over purely honorary titles. "De facto" precedence should be applied where, a non-ordained religious or lay ecclesial minister serves in an office equivalent listed below (e.g., a diocesan director of Catholic Education is an equal office to an episcopal vicar, a pastoral life director an equal office to pastor, though with respect to the principle of the hierarchy of order noted above).
Among honorary titles, geographic extent is considered (e.g., the national primate has precedence over a titular patriarch, as the former has an honorary title extending over an entire country, but the latter only over a single diocese).
If two persons hold the same office, precedence is given to the one of a higher order (e.g., of two episcopal vicars, one being a presbyter and the other an auxiliary bishop, the bishop takes precedence).
If two persons are of the same order and office, the one who was promoted earlier takes precedence (e.g., of two metropolitan archbishops, whoever was promoted to a metropolitan see first has precedence).
If two persons of the same order and office were promoted at the same time, precedence goes to the one who was ordained first (to that order) (e.g., of two priests appointed as pastors at the same time, whoever was ordained presbyter first has precedence).
In the case of cardinals of the same rank created at the same consistory, precedence is given according to the order in which their names were published.
In their own dioceses, bishops have precedence before other bishops and archbishops, but not before their own metropolitan. A metropolitan archbishop has precedence before all other bishops and archbishops (except the Pope, his Patriarch, or his Primate) within his own province, and a patriarch has precedence over other patriarchs within his own jurisdiction.
Similarly, in their own parishes, pastors have precedence before other presbyters and deacons, even monsignors, but not before their own dean or archdeacon.
Diplomatic precedence in the Holy See's diplomatic corps incorporates the Congress of Vienna (1815) and the updated Vienna Convention on Diplomatic Relations (1961). The office of nuncio (papal ambassador) is primarily a diplomatic rank and not of an ecclesiastical nature. Most nuncios are ordained as titular archbishops, and would be ranked accordingly. If, however, the nuncio is present in a diocese or at an event acting as the personal representative of the pope, as for example at the ordination of a bishop, he is granted precedence accordingly, taking precedence over even cardinals present. 
Patriarchs of autonomous ("sui iuris") churches have precedence above all other bishops of any rank, including cardinals. This has been defined in law since 1990. From 1965 to 1990, they were ranked as equal to Cardinal-bishops. It remains the case that, if a patriarch is also made a cardinal in the Latin Church, he is created at the rank of cardinal-bishop, without a named see, but retains his place of precedence. From the 1917 "Code of Canon Law" until the "motu proprio" of Paul VI in 1965, cardinals of all ranks took precedence over patriarchs. The current practice reflects a more Catholic, and less Latinized, ecclesiology.
Order of precedence.
Precedence of forms of consecrated life.
Within each category, precedence is determined by the date of founding of the institute, society, or association. 
Consecrated Life Forms
Institutes of Consecrated Life