Under the agreement signed by the Afghan defence minister and the US commander, US forces will play a supporting role in the raids.
The US military say night raids are a valuable way of finding and detaining suspected militants.
But many Afghans say the raids violate privacy and disrespect women.
The operations, currently carried out by Nato and Afghan special forces, have been a growing cause of friction between the Afghan government and the US military.
'We own the night'
The agreement comes ahead of the planned withdrawal of US and other foreign troops from Afghanistan in 2014.
The BBC's Bilal Sarwary in Kabul says the Afghan government wants to ensure that these operations are entirely led by its forces and that they give explicit permission for other troops to take part.
A senior Afghan general told the BBC that while the insurgents had the upper hand in daylight, "we [Afghan National Security Forces] and Nato own the night.
"These night raids have broken the backbone of the the Taliban and various other insurgent groups," the general said.
The deal will also allow Afghan judges to review the operations and decide whether to hold detainees after the raid.
Afghan officials told the BBC that last-minute discussions were still taking place over interrogation of detainees.