I think the question is asking about where we can apply the Work-Energy Theorem. So, to answer that, I believe we have to look at the derivation of the theorem. Also, I am still a high school student who may confuse all the concepts and give wrong answers. I am glad that you can leave a comment of you spot any error, thank you!
Before diving into the deviations, I think it is good to know that that there are actually different versions of Work-Energy Theorems with a few small differences. However, these little differences will determine where the theorem is valid. I will start with the most general one.
V1:
Sum of work done by all forces (both internal and external) on all particles in one system will be equal to the change in the sum of kinetic energy.
To see why this is true, let us consider a particle located at $\vec{x}$. Suppose there are n forces on it (both internal and external) labelled as $\vec F_1, ... ,\vec F_n$.
Then, we introduce the definition of work $W_i $ by a force $\vec F_i$ on the particle:
$$W_i = \int \vec F_i \cdot\text{d} \vec r_i = \int \vec F_i \cdot\text{d} \vec x $$
where $\text d \vec r_i$ is the displacement of the application point of $\vec F$ , which is the same as $\text d \vec x$ in this case as we are studying a particle.
Then the total work done by all forces on the particle is
$$W = \sum_i^n W_i = \sum_i^n \int \vec F_i \cdot\text{d} \vec r_i = \sum_i^n \int \vec F_i \cdot\text{d} \vec x = \int \sum_i^n\vec F_i \cdot\text{d} \vec x $$
Therefore, we see that the total work done on one particle by different forces is the same as the work done by the net force. As net force appeared, we can start using Newton's 2nd Law.
$$\begin{aligned}
W &= \int \sum_i^n\vec F_i \cdot\text{d} \vec x \\
&= \int m \vec a \cdot \text{d} \vec x \\
&= m\int \frac{\text d \vec v}{\text d t}\cdot \text{d} \vec x \\
&=m \int \text{d} \vec v \cdot\frac{\text d \vec x}{\text d t} \\
&= m \int \vec v \cdot \text d \vec v \\
&= m \frac{1}{2} (\vec v)^2 \\
&= \frac{1}{2} m v^2 .
\end{aligned}$$
So, we have shown that for one particle, the work done on it by all forces will just be the difference of kinetic energy. This is not difficult to generalise to a system of particles by considering and adding up all the work done by all forces on each particle. Thus, V1 is proven.
Even though V1 is correct, it is not convinient to use as daily objects always contain a huge quantity of particles whose internal interactions are hard to describe. Luckily, with one more constrain, at least some objects in daily life can be well modeled.
V2:
Sum of work done by external forces on a rigid body will always be equal to the change in its total kinetic energy.
Compare to V1, V2 allows us to focus on external forces. We can also see that, to make a progress from V1 to V2, it is necessary to show that property of rigid body can imply that the work done by internal forces will cancel out.
To show this, we can consider a pair of action-reaction forces, $\vec F_{ij}$ and $\vec F_{ji}$ [$\vec F_{ij}$ is the force by $i$ on $j$], between particles $i$ and $j$. Then, the sum of the works done by this pair of forces will be
$$W = \int \vec F_{ij} \cdot \text d \vec x_{j} + \int \vec F_{ji} \cdot \text d \vec x_{i}$$
By the property of rigid body that the distance between any 2 point will always remain the same, intuitively, $\text d \vec x_{j} = \text d \vec x_{i}.$
More rigourous proof will be differentiating the equation $(\vec x_{j}-\vec x_{i})^2 = d^2$ (Here is a link to MIT notes on work and energy, the page 9 has the proof).
Following from the result $\text d \vec x_{j} = \text d \vec x_{i}$,
$$\begin{aligned}
W &= \int \vec F_{ij} \cdot \text d \vec x_{j} + \int \vec F_{ji} \cdot \text d \vec x_{j}\\
&= \int (\vec F_{ij} + \vec F_{ji})\cdot \text d \vec x_{j} \\
&= 0.
\end{aligned}$$
Hence, any internal force pair will cancel each other's work out. V2 is proven.
V2 is quite helpful, but it generally cannot be applied to deformable objects such as springs. The reason is simple: we cannot ensure the internal work done will cancel each other out as the distance between any 2 points is not fixed.
So, this introduces the necessity for concepts such as conservative force and potential energy, which leads to conservation of mechanical energy.
In this question, the system of a spring and a block is deformable and V2 thus cannot be used here. Only V1 is valid. However, how do you consider all the internal work done in the spring? Modelling can work, but it will be very inconvenient and dirty. Luckily, spring provides conservative forces, and mechanical energy will then be a constant.
Therefore, Work-Energy Theorem V1 is defined for the system and V2 is defined for the block. It is just that V1 is hard to apply here. I guess, the confusion is actually from the theorem itself. For me, the distinction between V1 and V2 is never mentioned in school. And more extremely, some teachers may claim that (V3) the work done by external forces will be equal to change of $1/2m {v_{cm}}^2$ or (V4) the work done by net force on center of mass is equal to change of kinetic energy, which are only true for rigid bodies in pure translational motion. I also want to thank the author for the question. It really encourages me to think deeper about the idea of work and appreciate the convinience of rigid body.
Lastly, I will leave a lovely question on Work-Energy Theorem for you to ponder:
This is question 51 from 200 Puzzling Physics Problems. Hope you have fun 'work'ing on it.🤣