What is the difference between these wave functions?
The first function you have there

$\psi(x)=A\sin(\frac{2\pi x}{\lambda})$, 

is very similar to the function of a particle in a monodimensional box. 

This function is a very helpful example in order to understand how does the quantum mechanics works.

The other function is 

$\psi_{(n,m,l)}(r,\theta,\phi)=R_{n,l}(r) Y_{m,l}(\theta,\phi)$.

This function represents how an electron moves in a hydrogen atom and the full expression is quite different to the first function. Just see the representations:




Ok. The functions do not mean the same concept. So... Why do we use "$\psi$" in both?

In math we use $f(x)$ to speak about any function. In quantum mechanics we use $\psi(x)$ for the same: represent a function easily.

Yeah, but... Why do i have to study the first function if it's just a lie and not the full story?

Remember it's only a very good example. However, the particle in a box function can be used to determine the energy of an electron in a conjugated system as beta-carotene and it's energy for the first excited level. If you subtract the second energy to the first one it gives you the energy for a photon in the visible region: the carrot's orange color.

This means that the particle in a box is a good example if you start to study quantum chemistry and it even works as a good approximation for some systems.

Ok. Too much information but I want to know more: How can I get the second function from the first?

Well, that's... Impossible...

To obtain the functions we use the Hamiltonian operator, which contains the kinetic energy operator and the potential energy operator. 

For the particle in a box, we only use the kinetic energy operator because we don't have any potential into the box. This leads to the first function you have.

For the hydrogen atom we must use both operators (all the Hamiltonian) which means to include a function for the potential and we must work in 3D. The potential function can be obtained using the angular momentum. The spherical coordinates makes easier to work in 3D. This leads to radium and angular functions.

Summarizing, we have a different wave function for every different situation. This situation is what determines the function and it's conditions:


The particle in a box → Quantization.
The free particle → No quantization.
The electron in a hydrogen atom → Quantization + quantum numbers + rotation +... → Atomic orbitals.


Ok, seems legit, but it's hard to understand

I recommend you the books "Physical Chemistry" from Atkins, Levine or Engel to understand better the ideas and see the complete development.

In case you hate textbooks you can visit hyperphysics web page for a general looking.