The first evidence for off-shell Higgs boson production is reported in the final state with two Z bosons decaying into either four charged leptons (muons or electrons), or two charged leptons and two neutrinos, and a measurement of the Higgs boson width is performed. Results are based on data from the CMS experiment at the LHC at a center-of-mass energy of 13 TeV, corresponding to an integrated luminosity of up to 140 fb. The total rate of off-shell Higgs boson production beyond the Z boson pair production threshold, relative to its standard model expectation, is constrained to the interval [0.0061, 2.0] at 95% confidence level. The scenario with no off-shell production is excluded at 99.97% confidence level (3.6 standard deviations). The width of the Higgs boson is extracted as 3.2 MeV, in agreement with the standard model expectation of 4.1 MeV. The data are also used to set new constraints on anomalous Higgs boson couplings to W and Z boson pairs.