  (Abridged) Despite the success of Cold Dark Matter (CDM) in explaining a wide
range of observations, the microscopic nature of dark matter is still unknown.
Attempts to detect WIMPs, the most commonly studied form, have not yet
succeeded. Some predictions are even in apparent conflict with observations
(e.g. cuspy-cored halos and `missing satellite problem'). Therefore, it is
important to consider different forms of CDM. We focus on dark matter comprised
of ultralight bosons that form a Bose-Einstein Condensate (BEC), described by a
complex scalar field, and solve the Klein-Gordon and Einstein field equations
to evolve the Friedmann-Robertson-Walker universe. We find, in addition to
phases of radiation-, matter- and \Lambda-domination, an earlier phase of
scalar-field-domination. Moreover, while WIMP CDM is non-relativistic at all
times after it decouples, BEC scalar field dark matter (SFDM) is relativistic
at early times, evolving from stiff to radiation-like, before it becomes
non-relativistic (CDM-like) at late times. The timing of transitions between
these phases yields fundamental constraints on SFDM model parameters, particle
mass m and self-interaction coupling strength \lambda. We derive the range of
particle parameters required to match observations of the evolving background
universe, including the CMB and abundances of light elements produced by BBN,
characterized by N_eff, the effective number of neutrino species, and the epoch
of matter-radiation equality z_eq. This yields m >= 2.4*10^{-21} eV/c^2 and
9.5*10^{-19} eV^{-1}cm^3 <= \lambda/(mc^2)^2 <= 4*10^{-17} eV^{-1}cm^3. Our
model accommodates current observations in which N_eff at BBN is higher than at
z_eq, as probed by the CMB, otherwise unexplained by WIMP CDM. SFDM without
self-interaction (`Fuzzy Dark Matter') cannot satisfy current BBN constraints
within 68% confidence and is therefore disfavored.
