The Twelve Apostles form a quorum equal in authority and power to the First Presidency, meaning that “the Twelve Apostles hold all the authority and power that is vested in the First Presidency, but it cannot be exercised as long as the First Presidency is intact. On the death of the President of the Church, the First Presidency is dissolved, and then the Council of the Twelve Apostles exercises all the authority that was vested in the [First] Presidency, and this continues until the First Presidency is organized again and becomes the presiding council in the Church. . . . In no other way are [the First Presidency and the Quorum of the Twelve Apostles] equal in authority, and the First Presidency holds the keys of authority while the President of the Church is living” (Joseph Fielding Smith, Answers to Gospel Questions, comp. Joseph Fielding Smith Jr., 5 vols. [1957–66], 5:179).

Doctrine and Covenants 107:22–24

22 Of the Melchizedek Priesthood, three Presiding High Priests, chosen by the body, appointed and ordained to that office, and upheld by the confidence, faith, and prayer of the church, form a quorum of the Presidency of the Church.
23 The twelve traveling councilors are called to be the Twelve Apostles, or special witnesses of the name of Christ in all the world—thus differing from other officers in the church in the duties of their calling.
24 And they form a quorum, equal in authority and power to the three presidents previously mentioned.

Six weeks after the Prophet Joseph Smith was murdered, President Brigham Young said:

“Here is Brigham, have his knees ever faltered? Have his lips ever quivered? Here is Heber and the rest of the Twelve, an independent body who have the keys of the priesthood—the keys of the kingdom of God to deliver to all the world: this is true, so help me God. They stand next to Joseph, and are as the First Presidency of the Church.”

(History of the Church, 7:233.)