Measurements of the top quark polarization and top quark pair (t (t) over bar) spin correlations are presented using events containing two oppositely charged leptons (e(+)e(-), e(+/-)mu(-/+), or mu(+)mu(-)) produced in proton-proton collisions at a center-of-mass energy of 13 TeV. The data were recorded by the CMS experiment at the LHC in 2016 and correspond to an integrated luminosity of 35.9 fb(-1) . A set of parton-level normalized differential cross sections, sensitive to each of the independent coefficients of the spin-dependent parts of the t (t) over bar production density matrix, is measured for the first time at 13 TeV. The measured distributions and extracted coefficients are compared with standard model predictions from simulations at next-to-leading-order (NLO) accuracy in quantum chromodynamics (QCD), and from NLO QCD calculations including electroweak corrections. All measurements are found to be consistent with the expectations of the standard model. The normalized differential cross sections are used in fits to constrain the anomalous chromomagnetic and chromoelectric dipole moments of the top quark to -0.24 < C-tG/Lambda(2) < 0.07 TeV-2 and -0.33 < C-tG(I)/Lambda(2) < 0.20 TeV-2, respectively, at the 95% confidence level.