c. 1300, summe, "quantity or amount of money," from Anglo-French and Old French summe, somme "amount, total; collection; essential point; summing up, conclusion" (13c., Modern French somme), from Latin summa "the top, summit; chief place, highest rank; main thing, chief point, essence, gist; an amount (of money)," noun use (via phrases such as summa pars, summa res) of fem. of summus "highest, uppermost," from PIE *sup-mos-, suffixed form of root *uper "over."
The sense development from "highest" to "total number, the whole" probably is via the Roman custom of adding up a stack of figures from the bottom and writing the sum at the top, rather than at the bottom as now (compare the bottom line).
General sense of "numerical quantity" of anything, "a total number" is from late 14c. Meaning "essence of a writing or speech" also is attested from mid-14c. Meaning "aggregate of two or more numbers" is from early 15c.; sense of "arithmetical problem to be solved" is from 1803. Sum-total is attested from late 14c., from Medieval Latin summa totalis.