A first-quantized free photon is a complex massless vector field A = (A µ) whose field strength satisfies Maxwell's equations in vacuum. We construct the Hilbert space H of the photon by endowing the vector space of the fields A in the temporal-Coulomb gauge with a positive-definite and relativistically invariant inner product. We give an explicit expression for this inner product, identify the Hamiltonian for the photon with the generator of time translations in H, determine the operators representing the momentum and the helicity of the photon, and introduce a chirality operator whose eigenfunctions correspond to fields having a definite sign of energy. We also construct a position operator for the photon whose components commute with each other and with the chirality and helicity operators. This allows for the construction of the localized states of the photon with a definite sign of energy and helicity. We derive an explicit formula for the latter and compute the corresponding electric and magnetic fields. These turn out to diverge not just at the point where the photon is localized but on a plane containing this point. We identify the axis normal to this plane with an associated symmetry axis and show that each choice of this axis specifies a particular position operator, a corresponding position basis, and a position representation of the quantum mechanics of a photon. In particular, we examine the position wave functions determined by such a position basis, elucidate their relationship with the Riemann-Silberstein and Landau-Peierls wave functions, and give an explicit formula for the probability density of the spatial localization of the photon.