When to use Conservation of Energy vs Conservation of Momentum I am confused as to when each should be used to solve problems.I am not looking for the answer to this question, but I will include it here so you have all the information about what I am asking about. 

A 15.0 kg block is attached to a very light horizontal spring of force
  constant 400.0 N/m and is resting on a frictionless horizontal table.
  (See (Figure 1) .) Suddenly it is struck by a 3.00 kg stone traveling
  horizontally at 8.00 m/s to the right, whereupon the stone rebounds at
  2.00 m/s horizontally to the left. Find the maximum distance that the block will compress the spring after the collision.

I see that the idea suggested here (at Yahoo Answers) is to use conservation of momentum to solve this problem. But I wanted to solve using conservation of energy in the following way: 
$K.E =\frac{mv^2}{2}$
$Spring-P.E=\frac{kx^2}{2}$
$KE_i = KE_f + PE_f$
$KE_i - KE_f = PE_f$
Solving the equations, you get
$x = 0.670m$
The correct answer given is 0.387m.
 A: When to use which law
Your assumption that conservation of energy (considering only kinetic energy) works while dealing with the collision in the above question is not correct.
Conservation of energy (kinetic energy) doesn't appear to work in all kinds of collision. Some of the initial kinetic energy of the bodies are lost as heat and/or part of it is stored in the form of potential energy of the bodies (deformed body). These kind of collisions are called inelastic collisions.
Hence, direct application of conservation of energy with just kinetic energy terms is not possible. In these cases, the problem cannot be solved with just conservation of momentum. You need some experimental input (usually the coefficient of restitution is given). 
However, there are cases where conservation of energy (initial kinetic energy = final kinetic energy) is applicable. Such collisions are called elastic collisions.
Conservation of momentum is always valid and safe whereas conservation of energy requires all forms of energy including heat, sound, light, etc to be considered (which ever stated)
Solution to the given problem
In the above problem, the final velocity of the block is already given. By using the conservation of momentum, you can calculate the final velocity of the block.
Initial Momentum of the stone= $mv$ = $24$ $kg.ms^{-2}$
Applying the law of conservation of momentum,
$24 = m_{stone}v_{final-stone} + m_{block}v_{block-final}$
Substituting the given values in the equation, you get the final velocity of the block to be $2 ms^{-2}$.
Before the collision, the block was at its mean position. After the collision the block will begin to oscillate with the same mean position. 
The total energy of the system is equal to the kinetic energy supplied by the moving stone. When the block reaches its extreme position, all the energy will exist in the form of potential energy of the spring. Therefore, by applying the law of conservation of energy,
$\frac{mv^2}{2} = \frac{kx^2}{2}$
You get x to be $\sqrt{\frac{3}{20}}$
A: There is no general rule about which principle to apply. Both principles are always true. However, whether both or one or neither can be used in a particular problem depends on what information is available and what is required to be found. 
The usual advice still holds good : Make a list of the knowns, the unknowns, and what principles or equations might apply. Then look for the easiest or most reliable method of solution. There is no magic formula, no substitute for methodical thinking and intuition about what works best, both of which come from getting plenty of practice.
There are 2 parts to the given problem. As it happens, the 1st can only be solved by Conservation of Momentum and the 2nd only by Conservation of Energy.
Collision between the Stone and Block
You do not know (and cannot presume) that this is an elastic collision (ie one in which Kinetic Energy is conserved), so you cannot apply Conservation of Energy. Total energy is conserved, but there is no way of knowing how much of the initial KE is dissipated as heat or sound or permanent deformation of stone or block.
You can apply Conservation of Momentum here because you are told the 2 initial momenta and the final momentum of the stone. There is only 1 momentum left to find, so the 1 equation for Conservation of Momentum is enough to find it.
Note: If you had been told that the collision is elastic (ie KE is conserved) but not told the recoil velocity of the stone, you could use both conservation principles to find the 2 unknowns - viz. the final velocities of the stone and block.
Compression of the Spring
Here you know the initial KE (that of the 15kg block) and elastic PE (zero because the spring is not compressed). You also know the final KE (zero). The only unknown is the final elastic PE, so this can be found from the equation for Conservation of Energy.  From the latter you can calculate the compression of the spring.
Even if there is friction present then provided you are told the coefficient of friction you can calculate how much work is done against friction and include that in the energy balance equation. The same applies to other forms of energy transfer also.
Conservation of Momentum is not useful here because the compression in the spring is not related to its momentum.
