We describe the algorithm that selects the main sample of galaxies for spectroscopy in the Sloan Digital Sky Survey (SDSS) from the photometric data obtained by the imaging survey. Galaxy photometric properties are measured using the Petrosian magnitude system, which measures flux in apertures determined by the shape of the surface brightness profile. The metric aperture used is essentially independent of cosmological surface brightness dimming, foreground extinction, sky brightness, and the galaxy central surface brightness. The main galaxy sample consists of galaxies with r-band Petrosian magnitudes r 17.77 and r-band Petrosian half-light surface brightnesses l 50 24.5 mag arcsec À2 . These cuts select about 90 galaxy targets per square degree, with a median redshift of 0.104. We carry out a number of tests to show that (1) our star-galaxy separation criterion is effective at eliminating nearly all stellar contamination while removing almost no genuine galaxies, (2) the fraction of galaxies eliminated by our surface brightness cut is very small ($0.1%), (3) the completeness of the sample is high, exceeding 99%, and (4) the reproducibility of target selection based on repeated imaging scans is consistent with the expected random photometric errors. The main cause of incompleteness is blending with saturated stars, which becomes more significant for brighter, larger galaxies. The SDSS spectra are of high enough signal-to-noise ratio (S/N > 4 per pixel) that essentially all targeted galaxies (99.9%) yield a reliable redshift (i.e., with statistical error less than 30 km s À1 ). About 6% of galaxies that satisfy the selection criteria are not observed because they have a companion closer than the 55 00 minimum separation of spectroscopic fibers, but these galaxies can be accounted for in statistical analyses of clustering or galaxy properties. The uniformity and completeness of the galaxy sample make it ideal for studies of large-scale structure and the characteristics of the galaxy population in the local universe.