Mr. Stamos’ departure is part of several executive exits from the social network, which has been hit by scandals including Russian meddling on the platform in the 2016 presidential election and misuse of people’s data. The Times reported that Mr. Stamos was leaving Facebook after he had advocated the company to disclose more about Russian election interference last year but was met with resistance.

Mr. Stamos said in the interview that his last day at Facebook would be Aug. 17. At Stanford, he said, he planned to study the upcoming midterms and the role of technology, as well as election security more broadly and the topic of disinformation. He said he would also look at subjects as basic as passwords and try to reimagine how they could be made more secure.

Mr. Stamos also said Information Warfare was a new working group at Stanford with about 14 faculty members across academic disciplines. The group, which will begin meeting this fall, plans to research information warfare tactics and to develop countermeasures. Mr. Stamos said he planned to teach a class for law and policy students on how hackers attack, with the goal of familiarizing future policymakers with common hacking techniques.

Of his time at Facebook, he said, “Obviously, it has been a difficult three years. I’d like to take the things I’ve learned and apply them more broadly.”

Mr. Stamos previously worked as chief information security officer at Yahoo before joining Facebook in 2015. He has been vocal about cybersecurity issues. For example, in an address last year at Black Hat, a cybersecurity conference in Las Vegas, he argued that security professionals were overly focused on solving problems that were complex or bizarre and had lost sight of the everyday problems that plagued the internet.

Mr. Stamos said that over the course of his career, he had worked as a consultant for all of the major tech companies in Silicon Valley. That would help in his new role at Stanford, he said.

“Part of my goal is to help people find the right folks at these companies, to come up with structures in which we can have cross-disciplinary academic study,” he said, adding that he wanted to address issues including online child safety and the naming of a country or group responsible for a cyberattack.

“There aren’t good norms around a lot these things yet,” Mr. Stamos said.