The matter was under investigation and the boy's mother could be charged, police Inspector William Colarulo said.
The heroin was discovered Oct. 25. On Tuesday, the school sent a letter home to parents. The letter did not explain why the school waited three weeks to tell parents. It was sent home after a story about the incident aired on WCAU-TV.
Neither the child nor his classmates at Richmond Elementary School were harmed, a schools spokesman said.
"We are shocked and saddened, outraged" that a parent or parents could place a child in such danger, said spokesman Fernando Galliard.
The boy and his three siblings have been turned over to the city's Department of Human Services and placed in temporary custody, spokesman Ted Qualli said. The agency was looking for relatives who could eventually take care of the children.