When the Mormon prophet dies, he is replaced by the most senior apostle in the church. There is no election, but the members of the church are asked to collectively sustain the new prophet and president of the church.
The current prophet (written on April 5, 2015) is Thomas S. Monson. If he were to die, Boyd K. Packer would become the prophet. The members of the Quorum of the Twelve Apostles do not elect the new leader, as is seen in some other religions.
An important aspect of this transition is that the most senior apostle replaces the prophet–not the first counselor in the First Presidency. The Church of Jesus Christ of Latter-Day Saints is led by 12 apostles and the First Presidency. All of these leaders are sustained as prophets, seers, and revelators, so that when the prophet dies, the Priesthood authority is already present on the earth for the new prophet to take office.
Currently, the First Presidency of the Church is made up of Thomas S. Monson (President), Dieter F. Uchtdorf, and Henry B. Eyring. Although Presidents Uchtdorf and Eyring are in the first presidency, they have not been apostles for as long as Boyd. K. Packer. Thus, they will not become the prophet if President Monson were to die. If President Monson were to die, Presidents Uchtdorf and Eyring would no longer be members of the first presidency and would take their place in the Quorum of the Twelve (actually 14 at this point).
The President of the Church then selects his two counselors–almost always from the current 12 Apostles.
When a current President of the Church dies, it is often thought by outsiders that changes are likely to come in the church. Such is very rarely the case. The Quorum of the Twelve Apostles and the First Presidency make decisions only with complete unanimity. This means that decisions can take time for the church, but that the entire council is in agreement. Thus, the new prophet has worked with the previous prophet for so long in unanimity that differences in the way the church is administered are rarely seen.