The one-way and two way shape memory effects were studied in Ti-50.2 at%Ni alloy samples with different grain sizes. It was found that if the grain size was less than 80 nm, then all the residual strain obtained after deformation at −196 °C recovered on heating. An increase in grain size over 80 nm led to full strain recovery was observed when the residual strain was less than the threshold strain. An increase in the deformation temperature decreased the recovery coefficient K in small grains (less than 130 nm) and in large grains (500 nm or more) while the K increased in samples with an average grain size of 130 nm. The two-way shape memory effect was observed after deformation at −196 °C if a grain size was 80 nm or more. An increase in deformation temperature up to 25 °C resulted in the two-way shape memory effect was found in all samples, irrespective of the grain size. It was assumed that the dependence of the shape memory effects parameters on the grain size was controlled by the value of the local stress that appeared in the sample during deformation and the value of the yield stress for dislocation slip. An increase in grain size decreased the yield stress for dislocation slip and local stress in different manners: the variation in local stress was more intense in small grains and less so in large grains. An increase in the deformation temperature decreased the yield stress for dislocation slip more effectively than the local stress, and it led to an increase in the contribution of plastic deformation to the total residual strain.