Inclusive and differential cross section measurements of top quark pair ($\mathrm{t\bar{t}}$) production in association with a photon ($γ$) are performed as a function of lepton, photon, top quark, and $\mathrm{t\bar{t}}$ kinematic observables, using data from proton-proton collisions at $\sqrt{s}$ = 13 TeV, corresponding to an integrated luminosity of 138 fb$^{-1}$. Events containing two leptons (electrons or muons) and a photon in the final state are considered. The fiducial cross section of $\mathrm{t\bar{t}}γ$ is measured to be 137 $\pm$ 8 fb, in a phase space including events with a high momentum, isolated photon. The fiducial cross section of $\mathrm{t\bar{t}}γ$ is also measured to be 56 $\pm$ 5 fb when considering only events where the photon is emitted in the production part of the process. Both measurements are in agreement with the theoretical predictions, of 126 $\pm$ 19 fb and 57 $\pm$ 5 fb, respectively. Differential measurements are performed at the particle and parton levels. Additionally, inclusive and differential ratios between the cross sections of $\mathrm{t\bar{t}}γ$ and $\mathrm{t\bar{t}}$ production are measured. The inclusive ratio is found to be 0.0133 $\pm$ 0.0005, in agreement with the standard model prediction of 0.0127 $\pm$ 0.0008. The top quark charge asymmetry in $\mathrm{t\bar{t}}γ$ production is also measured to be $-$0.012 $\pm$ 0.042, compatible with both the standard model prediction and with no asymmetry.