Tension occurs when we have some reason to expect something might happen, but only partial information about it. (We don't know for sure.) Tension also happens if the thing is important.
Both are true here. The men talk about Curley's wife well before we meet her. In fact, after the fact that she's pretty, the first thing we learn about her directly is that he's seen her "give Slim the eye." We also get told that Curley's a boxer, that he's small, and that he's been on edge since he got married. So we have a woman with a wandering eye and a guy who wants to keep other men away.
Then Steinbeck shows Curley checking on his wife repeatedly; we never know where she is, and she comes and goes unexpectedly. Both of them come and go looking for one another.
Then, most simply, he tells us Curley is looking for his wife, that she's come and gone—and that Slim's been in the barn for a while.