Mayer's hiring, which edged out front-runner and acting CEO Ross Levinsohn, signaled the Internet company is likely to renew its focus on Web technology and products rather than beefing up online content.
Shares in Yahoo, less than half their value during its dotcom heyday, gained 2 percent to $15.97 in after-hours trading.
"It's a statement on Yahoo's part to go with a product-centric CEO choice. It's a very big commitment on the board's part to pursue a product-centric strategy," venture capitalist Marc Andreessen told the Fortune industry conference in Aspen, Colorado.
Tech companies can be turned around, he said, citing as an example Apple Inc, which had teetered on the brink of bankruptcy before Steve Jobs returned to the company he co-founded. "It's a big job that Marissa is stepping into," Andreessen said.
Mayer will assume her role on Tuesday, when the company is scheduled to report its quarterly financial results. On Monday, she tweeted that she was "incredibly excited" to be embarking on her new role.
Mayer, one of Google's earliest employees, was the Internet search company's first female engineer and has led various businesses at Google including the design of its flagship search engine. She most recently was responsible for Google's local and location services.
A year of turmoil
Mayer's appointment caps a tumultuous year at Yahoo. In May Scott Thompson resigned as CEO after less than 6 months on the job after a controversy over his academic credentials.
Thompson had replaced controversial Carol Bartz, who was fired in September after failing to revitalize Yahoo.
Yahoo had been widely expected to go with Levinsohn, who in his few months at the helm tried to push a strategy of forging media partnerships to beef up the company's online content.
Sources have said that he was committed to building out Yahoo's own video programming and striking more syndication deals in pursuit of ads that command higher prices.
"I just think it was uninspired," one source said on Monday, referring to Levinsohn's strategy.
A second source close to the situation said that Mayer, who is recognized in Silicon Valley as more focused on technology than content, would try to get Levinsohn to stay with the company.