"Charlie has demonstrated a strong track record in initiating and leading change, driving results, strengthening operational risk and compliance, and innovating amid a rapidly evolving digital landscape," Wells Fargo Board Chairwoman Betsy Duke said in a statement.
The bank struggled for months to find a candidate willing to take the top position since CEO Tim Sloan abruptly resigned in March after 31 years at the fourth-largest U.S. bank. Sloan was supposed to clean up the mess that had claimed his predecessor, John Stumpf, but failed to satisfy regulators' demands to overhaul the sprawling institution.
Stumpf announced his retirement in October 2016 after trying to deal with a scandal in which employees had created millions of fake bank accounts to meet sales quotas, severely damaging Wells Fargo's reputation and spurring scrutiny from regulators and Congress. Last year, the Federal Reserve capped the bank's asset growth after Wells Fargo discovered more problems with customer dealings.
The bank's general counsel, Allen Parker, took over as interim CEO after Sloan's resignation. Parker will continue in that role until Scharf joins the company.
BNY Mellon named CFO Thomas Gibbons as its interim CEO.
Scharf, 54, started his career in 1987 at Commercial Credit, a consumer finance company run by Jamie Dimon and Sandy Weill — executives who went on to lead two of America's biggest banks.
He was named Dimon's assistant six months into the job at Commercial Credit, according to an alumni magazine for the NYU stern business school.
"He moves from a bank with far less retail business than Wells Fargo, so he will face a steep learning curve," said Erik Gordon, a professor at the University of Michigan's Ross School of Business.
The lender's board had considered keeping Parker as CEO on a permanent basis even after saying they would seek an outsider to fill the role, sources had told Reuters in June.
Wells Fargo said Scharf's base salary at the bank would be $2.5 million — nearly the same as Sloan's base pay in 2018.
Regulatory filings showed that Scharf's total compensation for 2018 at BNY was $9.4 million. Sloan's total compensation for the year was $18.4 million.
Shares of Wells Fargo rose 3.1% in premarket trading from its previous close of $48.87 a share.
—CNBC's Maggie Fitzgerald and Reuters contributed to this report.