The recent developments in the design, planning, and operation of distribution systems indicate the need for a modern integrated infrastructure in which participants are managed through the perceptions of a utility company in an economic network (e.g., energy loss reduction, restoration, etc.). The penetration of distributed generation units in power systems are growing due to their significant influence on the key attributes of power systems. As a result, the placement, type, and size of distributed generations have an essential role in reducing power loss and lowering costs. Power loss minimization, investment and cost reduction, and voltage profile improvement combine to form a conceivable goal function for distributed generation allocation in a constrained optimization problem, and they require a complex procedure to control them in the most appropriate way while satisfying network constraints. Such a complex decision-making procedure can be solved by adjusting the dynamic optimal power flow problem to the associated network. The purpose of the present work is to handle the distributed generation allocation problem for photovoltaic units, attempting to reduce energy and investment costs while accounting for generation unpredictability as well as load fluctuation. The problem is analyzed under various scenarios of solar radiation through a stochastic programming technique because of the intense uncertainty of solar energy resources. The formulation of photovoltaic distributed generation allocation is represented as a mixed-integer second-order conic programming problem. The IEEE 33-bus and real-world 136-bus distribution systems are tested. The findings illustrate the efficacy of the proposed mathematical model and the role of appropriate distributed generation allocation.