Escobar terrorised Colombia in the 1980s and 1990s, bribing, kidnapping or killing all those who stood in his way.
Medellin Mayor Federico Gutierrez said Wiz Khalifa should apologise for "advocating crime".
He said Wiz Khalifa should have brought flowers to Escobar's victims instead.
Photographs posted by the 29-year-old rapper from Pittsburgh, who had played a concert in Medellin on Friday, showed flowers and a marijuana joint on the grave of Pablo Escobar.
Wiz Khalifa is a prolific consumer of marijuana who has had a strain of marijuana named after him which he markets with a company in Colorado.
But his offering to the late Colombian drug lord did not go down well with the Medellin mayor, who called the rapper a "scoundrel".
"It shows that this guy has never had to suffer from the violence inflicted by these drug traffickers," Mr Gutierrez said.
Pablo Escobar and his Medellin cartel are held responsible for about 4,000 killings, including the bombing of an airliner in which all 107 people on board were killed.
The city of Medellin has tried shed its image as the cartel's former headquarters ever since Escobar was shot dead by police in 1993.
The photos of Wiz Khalifa at the grave and also posing in front of the apartment building where Escobar lived therefore touched a raw nerve among many Colombians.
Wiz Khalifa himself has so far not commented on the anger he caused among some Colombians with his Escobar-themed tour of Medellin.