Any correctly posed mathematical problem involving differential equations requires boundary conditions (initial conditions are also a kind of boundary conditions). Otherwise it simply cannot be solved, although the issue is often glossed over in not very mathematically rigorous physics textbooks.
When it comes to the Schrödinger equation, one can distinguish two important types of problems: the eigenstates problems and the scattering problems. The examples of the former are a particle in a square well (with obvious boundary conditions) or the harmonic oscillator (with the boundary conditions at infinity - otherwise we would have more solutions than just usual ones with the Hermit polynomials). Note that these are usually supplemented by the normalization condition.
Scattering problems draw their inspiration from scattering problems in classical physics - for example, a problem of an asteroid passing near the Earth and being deflected by it. Note that even in this classical physical problem, one cannot strictly distinguish the states before, during and after the collision, since the gravitational potential has infinite range. In quantum mechanics this situation is compounded by the fact that the wave solution should exist everywhere in space. The ansatz presented in the question is a solution for a particle with a definite momentum (hence the incident plane wave) being scattered by a centrally symmetric potential (hence the centrally symmetric outgoing solution). In QFT-oriented texts such scattering experssions are motivated by analyzing the time evolution from the distant past, $t=-\infty$, to the distant future, t=+\infty$, but introductory texts often do not go into such depths... and sadly do not such problems as scattering by a rectangular barrier or tunnelinga s scattering problems at all.