The new law would require public sector employers and companies with more than 250 employees to give staff up to three days a year to do voluntary work, with businesses covering the cost.
Cameron said the proposal was "the clearest demonstration of the Big Society in action" and represented a "double win" for employees and communities.
Several organisations and businesses have welcomed the announcement.
Peter Cheese, chief executive at the CIPD, said: "Our research shows that corporate volunteering benefits businesses and their employees, as well as the communities in which they work. Not only does it help companies build stronger roots in their local communities, but it also gives employees an invaluable opportunity to develop new skills and give something back.
“It can also form part of a new relationship between organisations and their employees, helping them to attract and retain the right talent to meet their wider business objectives.”
The Chartered Management Institute’s (CMI) director of strategy Petra Wilton commented: “We welcome this new political focus on the value of volunteering… Volunteering often puts people outside of their comfort zone, gives them new working experiences and leads them to develop new management and people skills that they can bring back to their workplace.”
Wilton added however that making the scheme voluntary not mandatory would help its effectiveness. “This would better ensure that both employers and employees can be confident that it will be a mutually beneficial experience,” she said.
Labour criticised the proposal, with its civil society spokeswoman Lisa Nandy saying there was "no sense" of how the public sector could fund the pledge. "If just half of public sector workers took this up it would be the time equivalent of around 2,000 nurses, 800 police and almost 3,000 teachers,” she said.
But Cameron rejected suggestions the law could prove a financial burden for smaller firms and a logistical headache for organisations such as the NHS.
"It would be worked out according to patterns of work and would be worked out to ensure it did not cause inconvenience to the health service," he said.
39% of large organisations already offer paid time for their employees to take part in volunteering opportunities, with an additional 23% offering unpaid time, according to a recent CIPD report.
The From Big Society to the big organisation: the role of organisations in supporting employee volunteering report found that more than nine in 10 (93%) employers who offer time for staff to volunteer believe it provides a personal development opportunity.