ClearAll["Global`*"]; 
v = 10;  (* pull very quickly *)
tmax = 0.2/v;
m = 1.0;
g = 9.8;
k = 100.0;
ym0 = m g / k;
yh[t_] := ym0 + v t;
Ta[t_] := (ym[t] - ym0)k + m g;
Tb[t_] := (yh[t] - ym[t]) k;
soln= NDSolve[{
ym[0] == ym0,
ym'[0] == 0,
m ym''[t] == m g + Tb[t] - Ta[t]
}, ym[t], {t, 0, tmax}];
ymsoln[t_] := ym[t] /. soln;
Plot[{ymsoln[t]-ym0, yh[t]-yh[0]}, {t, 0, tmax}, PlotLegends->{"ym(t)", "yh(t)"}]
Plot[((m g + Tb[t] - Ta[t])/m) /. soln, {t, 0, tmax}, PlotLegends->"acceleration of block m"]
Plot[{Ta[t] /. soln, Tb[t] /. soln}, {t, 0, tmax}, PlotLegends->"Expressions"]

ClearAll["Global`*"]; 
v = 0.1;  (* pull very slowly *)
tmax = 0.2/v;
m = 1.0;
g = 9.8;
k = 100.0;
ym0 = m g / k;
yh[t_] := ym0 + v t;
Ta[t_] := (ym[t] - ym0)k + m g;
Tb[t_] := (yh[t] - ym[t]) k;
soln= NDSolve[{
ym[0] == ym0,
ym'[0] == 0,
m ym''[t] == m g + Tb[t] - Ta[t]
}, ym[t], {t, 0, tmax}];
ymsoln[t_] := ym[t] /. soln;
Plot[{ymsoln[t]-ym0, yh[t]-yh[0]}, {t, 0, tmax}, PlotLegends->{"ym(t)", "yh(t)"}]
Plot[((m g + Tb[t] - Ta[t])/m) /. soln, {t, 0, tmax}, PlotLegends->"acceleration of block m"]
Plot[{Ta[t] /. soln, Tb[t] /. soln}, {t, 0, tmax}, PlotLegends->"Expressions"]