I am interested in answering the question which has nothing to do with a "homework". The question has also no aim to "check my work" because I have no doubts in my calculations and I have added them only because some people in the comments found the result "not trivial". I have however still doubts in the basic concept.
In view of this I ask for reopening the question because there are obviously different opinions on the subject and people who do not agree with the accepted answer have right to tell their opinion.
The problem is following:
The volume of a cylinder is separated by a piston. There is some ideal gas at temperature $T_0$ and volume $V_0$ at one side of the piston and a spring at the other side. The piston is initially fixed so that the spring has the equilibrium length. Being relaxed the piston comes to rest at some position such that the gas volume becomes $V_1$ (obviously $V_1>V_0$). Find the new temperature of the ideal gas. Both the cylinder walls and piston are thermal insulators.
This assumed to be a school problem and it is easily solved assuming that the internal energy of the gas is given by $U=n c_V T$ and that the "lost" portion of the internal gas energy transfers to the potential energy of the spring.
Following the line one obtains: $$ \frac{T_0}{T_1}=1+\frac{\gamma-1}2\left(1-\frac{V_0}{V_1}\right)\tag1 $$ where $\gamma=\frac{c_p}{c_V}=1+\frac R{C_V}$ is the adiabatic index. Note that neither the mass of the piston nor the stiffness of the spring enters the solution.
However somebody with a high-school knowledge can consider this as an adiabatic process and use simply the equation $TV^{\gamma-1}=\text{const}$ so that $$ \frac{T_0}{T_1}=\left(\frac{V_1}{V_0}\right)^{\gamma-1}.\tag2 $$
Obviously the two solutions are different and therefore at least one of them is wrong. It seems Eq.(2) cannot be applied because the piston coming to rest implies the process is irreversible.
My question is therefore: is it conceptually wrong to consider an adiabatic process or can this be used in conjunction with other assumptions to provide a correct solution?
The derivation of the formula $(1)$
The energy conservation law reads: $$\begin{align} nc_V(T_0-T_1)&=\frac{k(x_1-x_0)^2}2\\ &=\frac{p_1A(x_1-x_0)}2\\& =\frac{p_1V_1(1-V_0/V_1)}2\\ &=\frac{nRT_1(1-V_0/V_1)}2.\tag{*} \end{align}$$ where we used $$\begin{align} &p_1A=k(x_1-x_0),&\text{net force is equal to $0$ in the final state}, \\ &A(x_1-x_0)=V_1-V_0,& \text{cylinder geometry},\\ &p_1V_1=nRT_1 & \text{ideal gas law}.\\ \end{align}$$
Resolving $(\text*)$ one obtains $(1)$.