This paper presents a Multi-Period Optimal Power Flow (MOPF) modeling applied to the minimization of energy losses in Distribution Networks (DNs) considering the reactive power control of Photovoltaic Generation (PVG) that can be applied to both short-term and long-term operation planning. Depending on the PV Power Factor (PVpf) limitations, PVG may provide both active and reactive power. The optimal power factor control on the buses with PVG contributes to an economical and safe operation, minimizing losses and improving the voltage profile of the DN. The proposed MOPF was modeled in order to minimize active energy losses subject to grid constraints and PVpf limitations. The variations of loads and PVG were discretized hour by hour, composing a time horizon of 24 h for day-ahead planning; nonetheless, the methodology can be applied to any other time period, such as a month, year, etc., by simply having generation and load forecasts. To demonstrate the effectiveness and applicability of the proposed approach, various tests were carried out on 33-bus and 69-bus distribution test systems. The analyses considered the DN operating with PVG in four different cases: (a) PVpf fixed at 1.0; (b) PVpf fixed at 0.9 capacitive; (c) hourly PVpf optimization; and (d) optimization of PVpf for a single value. The results show that a single optimal adjustment of PVpf minimizes losses, improves voltage profile, and promotes safe operation, avoiding multiple PVpf adjustments during the operating time horizon. The algorithm is extremely fast, taking around 2 s to reach a solution.