We overview our recent theoretical studies on nonlinear atom optics of the Bose-Einstein condensates (BECs) loaded into optical lattices. In particular, we describe the band-gap spectrum and nonlinear localization of BECs in one- and two-dimensional optical lattices. We discuss the structure and stability properties of spatially localized states (matter-wave solitons) in 1D lattices, as well as trivial and vortex-like bound states of 2D gap solitons. To highlight similarities between the behavior of coherent light and matter waves in periodic potentials, we draw useful parallels with the physics of coherent light waves in nonlinear photonic crystals and optically-induced photonic lattices.