What is the optimal amount of protein to take a day if you want to build muscle?
As a rule of thumb I recommend 1-2 grams of protein per pound of bodyweight. You should not go below 1 gram, and there is no real need to go above 2 grams (unless you're not a natural lifter). It's equally important that you consume your protein over the course of 5-6 meals per day.
Example: If you weighed 200lbs your total protein intake per day would be between 200-400 grams, spread out acrossed 6 meals your protein intake would be 33-66 grams of protein per meal.
The reason for this is you want to supply your body with adequate protein through out the day, and it should come from a variety of sources including beef, chicken, fish, milk, etc., which will ensure that your body has the necessary amino acids available at all times to support anabolism (building).
Another important time for protein that should be taken advantage of is post work-out, often referred to as the "anabolic window". The first 30-60 minutes after training your body is in a catabolic state and to help reverse this process and promote anabolism it's critical that you consume a high BV (biological value) protein within 30 minutes of training. The optimal protein at this time is whey because it is digested extremely quickly and the body can utilize the amino acids for growth and repair.