Gholamhossein Mohseni Ejei, a hardline cleric sanctioned by the West, takes the reins from Ebrahim Raisi, who was elected president last month.
Ayatollah Khamenei urged Mohseni Ejei, a senior cleric with a long history in the judiciary, to fight corruption "with determination".
Born in 1956, Mohseni Ejei holds the rank of Hodjatalislam, one rung below Ayatollah in the Shiite clerical hierarchy.
He has been both Iran's top prosecutor, and deputy head of the judiciary since 2014.
"With your legal powers and your valuable expertise, as well as the deep knowledge and shining precedents in judicial matters, I appoint you as head of the judiciary authority," Khamenei told Mohseni Ejei, in a message published on his website.
'Deliver justice... prevent crimes'
He also urged him to "deliver justice... provide legitimate freedoms, ensure the proper implementation of laws, prevent crime and fight corruption with determination."
Khamenei also praised Raisi's record in the position.
Ultraconservative Raisi was appointed by Khamenei as judiciary chief in 2019.
Raisi won outright on June 18 in the first round of a presidential election with around 62 percent of the vote, after his main opponents were disqualified.
There was a record low turnout for a presidential poll since the Islamic republic was established in 1979.
Who is Mohseni Ejei?
Mohseni Ejei came to public prominence in 1998, when he was judge in the controversial corruption trial of reformist former Tehran mayor Gholamhossein Karbastchi.
He later became minister of security, in the first 2005-2009 government of ultra-conservative president Mahmoud Ahmadinejad, but was sacked over disagreements between them.
According to the judiciary's Mizan Online news site, Mohseni-Ejei was born in the central province of Esfahan, where he studied religion, before completing his studies in the revered Shiite holy city of Qom.
He also holds a masters degree in international law.
Mohseni Ejei was among eight senior Iranian officials added to a US sanctions list for "serious human rights abuses" in 2010, over the crackdown against protests following presidential elections the previous year.
He also faces European Union asset freezes and travel restrictions for "serious human rights violations".
He will be the seventh head of the judiciary since the 1979 revolution, with a renewable five-year mandate.