Parshas Kedoshim (Vayikra 19:27)
It is a negative commandment that one may not shave the corner of one’s beard, as it says “And you must not destroy the corner of your beard!”, and there are five corners of the beard, for each of which there is a separate punishment of lashes. This is true even if he shaved them all off at one time with one warning. The five corners are the right upper and lower jaw, the left upper and lower jaw, and the place where the two sides of the jaws join in the middle. This makes five.
Amongst the roots of the commandment are that one must distance oneself from all aspects of idol-worship, and destroying the corners of the beard was also a custom of the priest of idols.
Amongst the laws of the commandment are that Chazal said that the prohibition is only when one shaves with a razor, as it says “You must not destroy!”, which means that the Torah forbade only destructive shaving, which refers to a razor. (We must here point out that many electric shavers might also be considered to be razors and one should ask a competent halachic authority about each machine separately).
This commandment applies in all places and at all times, but only to men.