can someone tell me how much protein i should drink when i work out and when to take it when i workout

you take protein after you workout and your muscles are recovering. I would take about 40-80 grams from a protein drink, any more than that and your body would be unable to digest the rest. Also I would improve your diet to intake more protein, the best foods to get protein are chicken, beef, milk, and eggs. You should try to eat 4 meals a day that will give you enough protein and other important nutrients like carbohydrates, nitrates, and calories which are also very important in muscle synthesis

Protein before a workout is also good.

and i also like it just before bed.

Actually, your body can only digest 45-50 grams of protein per meal, so any more than that is just wasteful and could damage your liver. Eat 5-7 meal a day to keep your metabolism up, get 20+ grams at every meal, and plenty of rest