Generally, fastener length is measured from the point where the surface of the material will be when the fastener is installed to the end of the fastener.
This style of fastener, length is measured from the bottom of the head when the fastener head will protrude above the mating surface. Typical head styles for this are Pan Head, Hex Washer Head, Round Head and many more.
The Flat Head (or Countersunk Head) is measured as an overall length. The top of this style of head will be flush with the surface of the component being fastened. 80, 90 and 100 degree head styles are measured this way.
Length of an Oval head fastener is measured from the corner where the angle and Oval Head radius meet, the corner that will match with the mating surface. The oval part of this head style will protrude above the surface of the component being fastened.