The mechanism of complex formation of two oppositely charged linear polyelectrolytes dispersed in a solvent is investigated by using dissipative particle dynamics (DPD) simulation. In the polyelectrolyte solution, the size of the cationic polyelectrolyte remains constant while the size of the anionic chain increases. We analyze the influence of the anionic polyelectrolyte size and salt effect (ionic strength) on the conformational changes of the chains during complex formation. The behavior of the radial distribution function, the end-to-end distance and the radius of gyration of each polyelectrolyte is examined. These results showed that the effectiveness of complex formation is strongly influenced by the process of counterion release from the polyelectrolyte chains. The radius of gyration of the complex is estimated using the Fox-Flory equation for a wormlike polymer in a theta solvent. The addition of salts in the medium accelerates the complex formation process, affecting its radius of gyration. Depending on the ratio of chain lengths a compact complex or a loosely bound elongated structure can be formed.