This problem was answered in
Stanley, Richard, Algebraic Combinatorics: Walks, Trees, Tableaux, and More, Springer New York, NY, 2013, https://doi.org/10.1007/978-1-4614-6998-8
Given a set of positive real numbers, $S$, and a positive real number $\alpha$, define $f_k(S,\alpha)$ to be the number of $k$-element subsets of $S$ whose sum is $\alpha$.
Theorem: ($6.11$ in Stanley) Let $n,k\in \mathbb N$, such that $n\ge k$. Let $S$ be a subset of $n$ positive real numbers, and let $\alpha\in \mathbb R^+$. Then
$$
f_k(S,\alpha)\le f_k(\{1,\dots,n\}, \lfloor k(n+1)/2\rfloor )
$$
That is, the greatest number of $k$-subsets with the same sum occurs when $S$ is an arithmetic progression, and when the target weight $k$ times the median of $S$ (rounded to the nearest integer).
All that remains is to determine $f_k(\{1,\dots,n\}, \lfloor k(n+1)/2\rfloor)$. In general, to compute $f_k(\{1,\dots,n\},\alpha)$, you need to enumerate sequences $1\le i_1<i_2<\dots<i_k \le n$ such that $i_1+\dots+i_k=\alpha$. Equivalently, letting $j_r=i_r-r$, we enumerate weakling increasing sequences $0\le j_1\le j_2\le \dots \le j_k\le n-k$ whose sum is $\alpha-\binom{k+1}2$. These correspond exactly to partitions of $\alpha-\binom{k+1}2$ with $k$ parts, whose parts are all at most $n-k$. It is well known that these occur as the coefficients of the $q$-binomial coeffiicents. Using this, Stanley states the following result, which completely answers your question.
Corollary: The largest possible number of $k$-subsets of an $n$-element set with the same sum is the coefficient of $q^{\lfloor k(n-k)/2\rfloor}$ in $\binom{n}{k}_q$.
For example, to fill out the last row of your table, we have $s=8$ and $k=3$, so we compute
$$
\binom{8}{3}_q=\frac{(q^8-1)(q^7-1)(q^6-1)}{(q^3-1)(q^2-1)(q-1)}=\\
q^{15} + q^{14} + 2 q^{13} + 3 q^{12} + 4 q^{11} \\ +
5 q^{10} + 6 q^9 + 6 q^8 + \color{blue}6 q^7 + 6 q^6 \\ +
5 q^5 + 4 q^4 + 3 q^3 + 2 q^2 + q + 1
$$
Since the middle, largest coefficient of this polynomial is $\color{blue}6$, we conclude that the largest possible number of $3$-element sets in an $8$-element set with the same sum is $\color{blue}6$, confirming what you thought. This is attained by the set $\{1,2,3,4,5,6,7,8\}$ (or any arithmetic progression of length $8$), and the target total of $\lfloor k\cdot \frac{s+1}2\rfloor =\lfloor 3\cdot \frac{8+1}2\rfloor =13$. These subsets are
$$
\{1,4,8\},
\{1,5,7\},
\{2,3,8\},
\{2,4,7\},
\{2,5,6\},
\{3,4,6\}
$$
Best Answer
$f(x)=-5$ when $x=(x_1, x_2, x_3,x_4, x_5,x_6,x_7)$ is one of the following 16 tuples,
$$\begin{array}{rrrrrrr} &(55, &28, &11, &16, &8, &1, &0) \\ &(57, &28, &11, &16, &8, &1, &0) \\ &(63, &32, &13, &18, &8, &1, &0) \\ &(63, &32, &13, &18, &10, &1, &0) \\ &(65, &32, &13, &18, &8, &1, &0) \\ &(65, &32, &13, &18, &10, &1, &0) \\ &(67, &34, &13, &20, &10, &1, &0) \\ &(69, &34, &13, &20, &10, &1, &0) \\ &(71, &36, &15, &20, &10, &1, &0) \\ &(73, &36, &15, &20, &10, &1, &0) \\ &(75, &38, &15, &22, &10, &1, &0) \\ &(75, &38, &15, &22, &12, &1, &0) \\ &(77, &38, &15, &22, &10, &1, &0) \\ &(77, &38, &15, &22, &12, &1, &0) \\ &(83, &42, &17, &24, &12, &1, &0) \\ &(85, &42, &17, &24, &12, &1, &0)\\ \end{array}$$
Claim: $f(x)\le-5$ when $x_1,x_3,x_6$ are odd and $x_2,x_4,x_5,x_7$ are even.
Proof: $$f(x)= -(x_1-x_2-x_3-x_4-x_6)^2 -(x_2-x_3-x_4-x_6)^2\\ -3 x_3^2 - 2 x_4^2 - 2 x_5^2 - 68 x_6^2 - (x_6-x_7)^2- x_7^2\\ + 4 x_3 x_4 + 4 x_3 x_6 + 2 x_4 x_5 + 4 x_4 x_6$$ Since $(\text{an even number})^2\equiv0$, $(\text{an odd number})^2\equiv1$, $2(\text{odd number})\equiv2$ $\pmod4$, we have $$f(x)\equiv-1-0-3-0-0-68-1-0+0+0+2+0=-71\equiv3\pmod4$$
Thanks to Will Jagy's answer, we can express $f(x)$ as a negative combination of squares.
$$\begin{aligned}f(x) = -(x_1-x_2-x_3-x_4-x_6)^2&\\ -(x_2-x_3-x_4-x_6)^2&\\ - 3(x_3-\frac23x_4-\frac23x_6)^2&\\ - \frac23(x_4-\frac32x_5-5x_6)^2&\\ - \frac12 (x_5-10x_6)^2&\\ - (x_6-x_7)^2 &\\ - x_7^2& \end{aligned}$$
Since $x_6$ is odd while $x_7$ is even, $x_6\not=x_7$. So $(x_6-x_7)^2\ge1$.
Since $f(x)\le -(x_6-x_7)^2\le-1$, all we need to prove is $f(x) \not= -1$.
Suppose $f(x)=-1$. Since $(x_6-x_7)^2\ge1$, we must have $$\begin{aligned} x_1-x_2-x_3-x_4-x_6&=0\\ x_2-x_3-x_4-x_6&=0\\ x_3-\frac23x_4-\frac23x_6&=0\\ x_4-\frac32x_5-5x_6&=0\\ x_5-10x_6&=0\\ x_6-x_7&=1\\ x_7&=0\\ \end{aligned}$$ That means, $x_7=0$, $x_6=1$, $x_5=10$, $x_4=20$, $x_3=14$. However, we require $x_3$ be odd. Hence $f(x)\not=-1$. $\quad\checkmark$
Hence $M=-5$.