Steven Williams, 25, is accused of shooting the victims between September 2018 and May 2019.
Williams collected thousands of dollars for committing the murders, D.A. Larry Krasner said.
"His streak of wanton, violent crimes against our communities over the past two-plus years ends today," he said.
Williams was already in prison for unrelated crimes in Montgomery County, Krasner said.
Investigators released the following details about the crimes:
The first victim was shot and killed while sitting in his son's car on September 8, 2018 in the 1900 block of Hartel Avenue.
The second victim was shot and killed while getting out of his car on February 10, 2019 in the 7500 block of Forrest Avenue.
The third victim was shot and killed while sitting on the porch of a home on March 25, 2019 in the 100 block of Meehan Street in the East Mount Airy.
The fourth victim was shot and killed while sitting in a parked car on May 4, 2019 in the 2000 block of W. Girard Avenue.