Visual prostheses aim to restore vision to people blinded from degenerative photoreceptor diseases by electrically stimulating surviving neurons in the retina. However, a major challenge with epiretinal prostheses is that they may accidentally activate passing axon fibers, causing severe perceptual distortions. To investigate the effect of axonal stimulation on the retinal response, we developed a computational model of a small population of morphologically and biophysically detailed retinal ganglion cells, and simulated their response to epiretinal electrical stimulation. We found that activation thresholds of ganglion cell somas and axons varied systematically with both stimulus pulse duration and electrode-retina distance. These findings have important implications for the improvement of stimulus encoding methods for epiretinal prostheses.