Bin packing variant for maximizing value in a bin
This is the knapsack problem.  It is NP-complete, so there are no algorithms that are both efficient on all problem instances and always optimal, but there are many different techniques that yield different points in the tradeoff between computation time and quality of the solution.