Renewable energy sources provide an environmentally sustainable solution to meet growing energy demands. Consequently, photovoltaics (PV) is regarded as a promising form of green distributed generation (GDG). The penetration of PV-GDG into distribution networks (DNs) is crucial, presenting a significant opportunity to improve power grid quality and reduce power losses. In this study, a comprehensive investigation was conducted to determine the optimal location, number, and capacity of PV-GDG penetrations with DN to achieve these objectives. Therefore, employing the Newton–Raphson (NR) technique and particle swarm optimization (PSO) approach for case studies, the analysis focused on the IEEE 33 bus test system as a benchmark test and the Iraq–Baghdad DN at 11 kV and 0.416 kV as a real case study. The outcomes revealed that integrating 4 × 1 MW PV-GDG units in a centralized configuration at bus 13 of the 11 kV Rusafa DN in the first scenario significantly reduced power losses and alleviated voltage drops across the network. In contrast, the second scenario entailed the utilization of dispersed PV panels with a capacity of 10 kW installed on rooftops at all 400 consumer load points with a cumulative capacity of 4 MW. This approach exemplified the enhancement of DN performance by significantly maximizing the power loss reduction and minimizing the voltage drops across the buses, exceeding the results achieved in the first scenario. The software applications employed in the practical implementation of this study included the CYMDist 9.0 Rev 04 program, PVsyst 7.2.20 software, and MATLAB R2022b.