If you want a side of the head shot you would be much better off putting the gun behind the ear. There is a better chance of an effective shot to the parts of the brain that is lights out.
Shooting at the temple comes with risks. Flinch and you might hit one of the hemispheres leaving the other to pick up the slack. Another issue is that the frontal lobe is good for higher brain functions but doesn't really do much for the most basic of function like keeping your heart beating and your lungs breathing.
A lot of people die each year after being shot from a 9mm gun. That said I'd say it's as small of a caliber you would want to use. I strongly stress that you would want to use a hollow point round that would mushroom upon impact. Self defense rounds are the best.
.40, .44, or .45 acp all have a larger projectile and will make a bigger hole and bullet track through a brain. Once again self defense or hollow point bullets are highly recommended.
If you want to discuss it further or have more questions regarding caliber or techniques just hit me up.