Pairs of lepton and antilepton (dilepton) in a continuous mass range are one of the most experimentally challenging and golden probes of the quark-gluon plasma (QGP) produced in heavy ion collisions because they do not strongly interact with the hot and dense medium, and reflect the properties of the medium at the time the dilepton is generated. The measurements of dileptons require lepton identification with high purity and high efficiency at large detector acceptance. STAR is one of two large experiments at the relativistic heavy ion collider with a primary goal of searching for the QGP and studying its properties. The STAR experiment launched a comprehensive dielectron (e+e−) program enabled by the time-of-flight (TOF) detector that had been fully installed in 2010. In this article, we review the decade-long R&D, the construction and performance of the STAR TOF detector, and dielectron measurements, including thermal dielectron production and dielectron production from the Breit–Wheeler process. Future perspectives are also discussed.