It may not sound very helpful (sorry!) but the right amount of insulin is the amount which keeps your blood glucose at normal levels. By that I mean around 5 at all times if possible.
However, too much insulin is a cause of many long term health problems, so it's important to keep its use down where you can. That's one reason why it's important to avoid both sugars and starches, both of which require large quantities of insulin.
As for when to take it, you need to take your fast acting just before you eat (5-10 mins). Your basal or long acting insulin should be taken at the same time every day. Some take it as a single dose, but many find significant advantages in splitting the dose into 2, again both taken at consistent times.
Sugar cravings often disappear if you can eliminate the foods which cause them for a few weeks. If you can do that, your blood glucose levels will stabilise and your mood swings will disappear.
All the best,
fergus