On Sunday, the government announced it would temporarily scrap the fuel tax in an attempt to stabilise petrol prices.
But lorry drivers and farmers blocked roads in much of the country again on Monday.
The government says four people have died in the protests.
President Castillo announced the curfew after a meeting with his Council of Ministers.
He also declared a state of emergency for Lima and Callao, suspending some rights such as freedom of assembly and the right to circulate freely.
"I call for calm and serenity. Social protest is a constitutional right, but it must be done within the law," President Castillo said in a TV address.
The curfew - which will affect some 10 million people - has been widely criticised as "authoritarian" by critics of the president.
The prices of fertilisers and fuel have shot up in Peru since the start of the war in Ukraine.
Lorry drivers started to block major roads last week, which in turn triggered a rise in food prices.
Some of the protests turned violent on Monday, with protesters burning toll booths.
The protests come at a time when Peru is already suffering from high inflation and the president's popularity is low.
The left-wing leader has been in power since July after winning by a slim majority. Opinion polls suggest his approval rating has since dropped to about 25%.
In his short term in office, he has renewed his cabinet on a number of occasions, replacing key ministers, and survived two impeachment attempts.
Impeachment proceedings are relatively common in Peru, where the legislative and the executive are often at loggerheads.