The move is a tightening of a curfew already in place since December, which restricts movement from 20:00-06:00.
Announcing the measure on Thursday, Mr Castex described the country's situation as "worrying" with infections remaining at a "high plateau".
He also announced new restrictions for people arriving into the country.
France has so far recorded more than 69,000 coronavirus deaths - the seventh-highest death toll in the world.
The new national curfew will stay in place for at least 15 days and means everyone must be at home, unless they are returning from school or work, by 18:00 every day.
All shops and businesses will have to close when the curfew begins, except for emergency services.
The tighter evening restriction was already in place in some hard-hit eastern regions of the country before Thursday's announcement and, according to the French Scientific Council, has led to infection rates slowing.
However some people have criticised the curfew, claiming that it will create larger groups of people, all trying to get home in time before it comes into force.
Women's rugby coach Felicie Guinot lives in Marseille, where an earlier curfew is already in place. She told AP news agency that rush hour traffic in Marseille was heavy.
"It's a scramble so everyone can be home by 6pm," she said.