The disciplinary committee of world football's governing body Fifa handed out the punishment after the 33-year-old tested positive for cocaine metabolite benzoylecgonine.
The drug control came following Peru's match in Buenos Aires against Argentina on 5 October. Peru eventually qualified for the tournament in Russia next summer following a 2-0 aggregate win in the inter-continental play-off against New Zealand in November.
Guerrero, who plays for the Brazilian club Flamengo, has scored 33 goals in 84 ppearances for his country. He was suspended for the two legs against New Zealand while his case was under review.
His ban was extended for another three weeks on 5 December before the final decision on Friday.
On 1 December, during a lavish ceremony in Moscow, Peru were drawn in Group C with France, Australia and Denmark.