There are, apparently, two different theories as to why this size change happens. One is that changing height is just something that Luke Skywalker just does in universe. It’s part of his character even though it’s never questioned or brought up at any point in any movie. The other, which in its own way makes more sense, is in line with the old Paul McCartney is Dead theory. Namely that there are two actors playing the role of Luke Skywalker. Though who the other guy is, or why he is being used, has never been adequately explained.
Mark Hamill’s time in Star Wars is available to re-watch on Disney+. You can use this link to sign up for the streaming service.