"Direct sum" and "direct product" did not use to mean what they now mean in the OP sense, and even today the old usage persists. Van der Waerden in Moderne Algebra (1930-31) (the following section numbers are given according to the 1967 edition) uses "direct sum" when additive convention is assumed for the operation (e.g. for rings and modules, §92) and "direct product" when multiplicative convention is (e.g. for general groups, §53). He also uses "direct product" for what is now called tensor product (§67) in a special context of Galois theory, but that section was added in 1967. Van der Waerden's book is based on Artin's and Emmy Noether's lectures from mid 1920s. Sum/product distinction based on the additive/multiplicative convention is still current in group theory.
Murray and von Neumann used "direct product" for tensor product (of vector spaces) from 1936 on, they also pioneered the symbol ⊗, see History: Direct Product became Tensor Product? This is related to similar use for matrices, e.g. in MacDuffee, The Theory of Matrices (1933), where "direct sum" stood for combining matrices block-diagonally, and "direct product" for 'Kronecker' product. Kronecker had little to do with it, but the name stuck after Hensel c. 1890 (Zehfuss introduced it back in 1858, see Henderson et al., On the history of the Kronecker product). "Direct product" is still occasionally used.
Bourbaki decided to tidy it up and sort it out in their Algebra I (multilinear algebra, 1948). There they reserved "direct product" (of modules) for the Cartesian product (regardless of conventions about the operation), "direct sum" for its subset with only finitely many non-zero entries, and separated it from "tensor product" following Whitney's 1938 general definition, see Origin of the modern definition of the tensor product. All of this happened before categorical notions of universal property, product and coproduct became fashionable in 1950s. But yes, Bourbaki's cleanup was likely motivated by working with infinite sums and products.