Pfeiffer has advised Obama since the 2008 presidential campaign and is one of the last of the president's close confidants from that period to be leaving his immediate orbit.
"Like everyone else in the White House, I've benefited from his political savvy and his advocacy for working people," Obama said in a statement. "He's a good man and a good friend, and I'm going to miss having him just down the hall from me."
Pfeiffer served as White House deputy communications director and communications director before taking on the title of senior adviser. He is fond of sparring with reporters on Twitter and has spearheaded the administration's effort to use social media to spread its message, sometimes seeking to bypass traditional news organizations in the process.
Obama has been criticized routinely for relying too much on an insular group of advisers, many of whom stemmed from his Chicago-based campaign. But communication gurus such as David Axelrod and David Plouffe, who both spent stints in the White House after helping get him elected, have long since moved on.
Pfeiffer has experienced some health difficulties in recent years, including stroke-like symptoms.
He informed the president about his decision to leave last month, a White House official said, and had been thinking about it for a long time.
(Reporting by Roberta Rampton and Jeff Mason; Editing by Susan Heavey)