An administration official said President Barack Obama was notified a month ago, and she is planning to leave her post in early September.
Mr. Obama issued a statement commending Napolitano for "her outstanding work on behalf of the American people over the last four years."
Napolitano was appointed in 2008 and led the department through a series of policy changes, including a focus on enforcing immigration laws. She was just the third person to lead the 10-year-old department
"At the Department of Homeland Security, Janet's portfolio has included some of the toughest challenges facing our country. She's worked around the clock to respond to natural disasters, from the Joplin tornado to Hurricane Sandy, helping Americans recover and rebuild," the president said.
It was not immediately clear who Mr. Obama was considering as Napolitano's replacement.
"For more than four years I have had the privilege of serving President Obama and his Administration as the Secretary of Homeland Security," Napolitano said in a statement. "I thank President Obama for the chance to serve our nation during this important chapter in our history, and I know the Department of Homeland Security will continue to perform its important duties with the honor and focus that the American public expects."
Napolitano, a former Arizona governor and attorney general, was nominated Friday to become president of the UC system. She will be the first woman to head the UC system in its 145-year history.
"The search for a new leader for UC was extensive, with more than 300 potential nominees reviewed. Secretary Napolitano rose to the top and received a unanimous vote of recommendation from the Special Committee," UC Regent Sherry Lansing said in a statement.
The Associated Press contributed to this report.