Where we Use Dynamic Programming and Greedy Algorithm?
Greedy Algorithm:


  An algorithm that always takes the best immediate, or local, solution while finding an answer. Greedy algorithms find the overall, or globally, optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems. [1]. 


Problems that can be solved by a Greedy Algorithm will have two properties:


Greedy Choice Property;
Optimal Substructure.


Essentially, Greedy Algorithms solve combinatorial problems having the properties of matroid.

For more detail you can consult Introduction to Algorithm.

Dynamic Programming:


  Solve an optimization problem by caching subproblem solutions (memoization) rather than recomputing them.  [2]


Dynamic Programming algorithms are often used for optimization because it will examine the previously solved subproblems and will combine their solutions to give the best solution for the given problem. 

Now, problems that can be solved by a Dynamic Programming Algorithm will have this necessary condition:


  Principle of Optimality: An optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision. [3]