The production of Z bosons with one or two isolated high-energy photons is studied using pp collisions at root s = 8 TeV. The analyses use a data sample with an integrated luminosity of 20.3 fb(-1) collected by the ATLAS detector during the 2012 LHC data taking. The Z gamma and Z gamma gamma production cross sections are measured with leptonic (e(+) e(-), mu(+) mu(-), nu(nu) over bar) decays of the Z boson, in extended fiducial regions defined in terms of the lepton and photon acceptance. They are then compared to cross-section predictions from the Standard Model, where the sources of the photons are radiation off initial-state quarks and radiative Z-boson decay to charged leptons, and from fragmentation of final-state quarks and gluons into photons. The yields of events with photon transverse energy E-T > 250 GeV from l(+) l(-) gamma events and with E-T > 400 GeV from nu(nu) over bar gamma events are used to search for anomalous triple gauge-boson couplings ZZ gamma and Z gamma gamma. The yields of events with diphoton invariant mass m(gamma gamma) > 200 GeV from l(+) l(-) gamma gamma events and with m(gamma gamma) > 300 GeV from nu(nu) over bar gamma gamma events are used to search for anomalous quartic gauge-boson couplings ZZ gamma gamma and Z gamma gamma gamma. No deviations from Standard Model predictions are observed and limits are placed on parameters used to describe anomalous triple and quartic gauge-boson couplings.