The visualization of an Apple as the "forbidden fruit" is largely a Western Christian iconography. In Eastern Christian and Jewish art, it is more usually depicted as a pomegranate, but sometimes a a bunch of figs or grapes.
When Jerome (Eusebius Sophronius Hieronymus) was translating the Christian Bible from Greek/Hebrew into Latin, he chose to translate the Hebrew word perei, which generically means tree-fruit of any sort, into Latin as malus which also means fruit, but also has a more specific meaning of "apple". Jerome probably picked this word because it makes a pleasing pun on the Latin word for "bad" which is also malus when conjugated in the nominative case.
This is most likely the origin for the notion that the forbidden fruit in the garden was an apple, and the depiction as such in artworks.
Of course, the Bible makes no mention of apples specifically in the Garden of Eden. The first person to describe the tree this way was John Milton in Paradise Lost. This means the image is far newer than Early Christian societies who, (speculation here), would probably have imagined it as a fig tree or whatever was local. As for why Milton picked the apple over some other fruit, the short answer is it's sort of a pun in Latin.