Measure the perimeter of the mattress the sheet goes over, stretch the elastic as you sew it on.
I think I cut mine about 5” shorter than the mattress perimeter when I made crib sheets. I made sure the sheets would fold under the mattress and stay snug.