David Cameron says the Data Retention and Investigation Powers Bill is needed to fight "criminals and terrorists".
But civil liberties groups say it infringes the right to privacy and sets a dangerous precedent.
It comes after the European Court of Justice struck down existing powers.
An EU directive requiring phone and internet companies to retain communications data - when and who their customers called, texted and emailed but not what was said - for a 12 month period was ruled unlawful in April by the European Court.
Without a new law being passed in the UK to retain the powers, Mr Cameron claims that that information could be destroyed within weeks by companies fearing legal challenges, meaning police and the security services will not be able to access it.
A special cabinet meeting is being held on Thursday to agree the planned laws, which will have a "sunset clause" meaning they will lapse in 2016.