The match's regular time ended 0-0 as the extra time decided the victorious team at Istanbul's Ulker Stadium.
Home team Fenerbahce broke the deadlock in the 94th minute.
Nigerian winger Bright Osayi-Samuel was brought down in the box and Fenerbahce were awarded a penalty kick.
Ecuadoran forward Enner Valencia scored from the white spot to give his team a 1-0 lead in the early minutes of extra time.
Osayi-Samuel made it 2-0 in the 99th minute and Fenerbahce cemented their win.
Fenerbahce's Czech left-back Filip Novak found Osayi-Samuel in the area as the 23-year-old was unmarked to fire a low shot that beat Afyonspor goalkeeper Anil Atag.
With the win, Fenerbahce bagged the last 16 ticket in the 2021-22 Turkish Cup.
In addition to Fenerbahce, Adana Demirspor, Fraport TAV Antalyaspor, Aytemiz Alanyaspor, Altas Denizlispor, Goztepe, Atakas Hatayspor, VavaCars Fatih Karagumruk, Kasimpasa and Trabzonspor advanced to the last 16 phase.