Will a light come back within finite years? In this answer Javier said

Imagine the universe was the inside of a ball. We're 3D now, so no one is hiding any dimensions. This ball has a border, except it's not really a border. You should think of the whole sphere (the border of the ball) as being just one point: if you travel from the center to the "border" you can come out anywhere on this "border" depending on your direction of travel. In particular, if you go straight at it you will come out on the other side and eventually go back to the center. This is one way of visualizing a 3-sphere.

So it seems a beam of light, shooting to any direction, if not met by an object to block it, will eventually return to the starting point, within a finite amount of years.
However, in the same answer he quoted
Did the Big Bang happen at a point?
where the top answer by John Rennie says:

Imagine measuring our current universe by drawing out a grid with a spacing of 1 light year. Although obviously, we can't do this, you can easily imagine putting the Earth at (0, 0), Alpha Centauri at (4.37, 0), and plotting out all the stars on this grid. The key thing is that this grid is infinite1 i.e. there is no point where you can't extend the grid any further.

According to this it seems the beam of light will go on and on infinitely, and not coming back...
So I'm confused... will the beam of light come back? within finite years?
 A: It depends on the geometry of the universe.  If the universe is flat (zero curvature), it is infinite in extent and therefore the light beam will not come back.  However, if the universe has spherical geometry (positive curvature), i.e. modeled by a 3-sphere which is discussed in this post, it is closed and therefore the light beam could in fact return to where it started.
Nevertheless, as noted by Chris, taking into consideration the ever more increasing expansion rate of the universe, the light beam will indeed have no chance to return back where it started.
Additionally, current observational evidence (e.g. by WMAP, BOOMERanG, and Planck) suggests that the universe is flat.  Still, we can't be entirely sure, since even if the universe had spherical geometry it would still look locally flat.
A: Well, the two answers are not talking about the same thing.
What Javier was describing is what the asker was inquiring about in their question: a "finite but unbounded" periodic universe.
From the question:

"There's the "ant on a ballon's surface" story
that's often told if it comes to trying to unravel the knot in
people's brains due to this (alleged) contradiction [how can it be finite but unbounded]. But it leaves out a whole dimension of space."

This is one hypothetical way the universe could be - but we don't know if it is actually like that. There's no observational evidence that it is.
A two-dimensional ant-like creature embedded into the surface of the balloon could go straight for a while, go around its balloon universe, and eventually come back into the region of the surface it started from. In order to find a way to think about how this would work in a 3D universe, you have to resort to a trick - you have to find a different way to understand what's going on in the 2D case that generalizes to the 3D case better.
Now imagine making a cut in the balloon's surface; only you are aware of the cut, from your god-like perspective, the 2D creatures inhabiting that universe are not. In particular, as far as they are concerned, the "connectivity" of their universe is not broken - if they go over the cut, they re-appear at the corresponding point on the other edge of the cut, and just continue on. To them, there is no cut. To you, the cut is a teleporting device, a gateway.
If you widen the cut enough so that you can flatten the balloon onto a table, you get something that behaves similar to the the Pac-Man video game. If you go over one edge of the screen, you re-appear on the other side. It's not exactly that - the topology of a Pac-Man screen is that of the surface of a torus, but it's the same general idea. It's a periodic universe because, from the perspective of its inhabitants, it repeats itself at regular spatial intervals.
That's what Javier is talking about:

"If you really want to try to visualize a periodic universe, try this
one. Imagine the universe was the inside of a ball. We're 3D now, so
no one is hiding any dimensions. This ball has a border, except it's
not really a border. You should think of the whole sphere (the border
of the ball) as being just one point"

This is similar to making a cut in the balloon, except that, instead of a cut, you just make a puncture, and then you stretch out the edges of that puncture until you can flatten the balloon. So, the boundary you obtained now represents a single point, and as a 2D ant inhabitant of the balloon universe approaches the edge, the ant is stretched out across it before it reappears on the other side, the distortion decreasing as it moves away. This is purely a consequence of your mapping, remember, for the ant, there is no edge. It's like this map projection (the orange circles/ellipses on the right indicate the distortion):

This gives you a way to think about how a 2D creature would move around on a sphere, without you having to "step outside" the 2D universe in order to imagine a sphere in 3D space. This is good, because we can't really imagine what it would be like to "step outside" our 3D universe, and we want to generalize to the 3D case.
So in a 3D periodic universe, something similar would happen - you'd eventually hit the teleporting border in the "sphere", pass through it, and reappear at the other end. Except that, for you, there is no border - as far as you're concerned, it's just the way the fabric of your universe is intrinsically interconnected. Note that there doesn't have to be an external, "larger" universe that embeds our own for this to be possible.
In such a universe, a light ray could eventually come back (expansion of the universe aside).
Javier goes on to say

"The observations collected so far seem to say that the universe is
infinite and more or less flat."

So, it doesn't look like we live in a 3D equivalent of a balloon universe, but the periodicity could be much larger than the size of the observable universe, so, who knows.
John Rennie's answer, on the other hand, talks about the Big Bang singularity, and in the answer, an infinite, flat universe is assumed (there's a discussion about this at the very end). John Rennie's answer was quoted in the first post to drive home the idea that an infinite universe was always infinite.
If the universe is like that, an unimpeded light ray would never come back.
A: We don't know if the universe is finite or infinite. John Rennie's answer alludes to this in the latter parts- it is either infinite (and has always been infinite) or finite (but without an edge, so it must "loop back" on itself).
There is a model of the universe where a light beam could return back to where it started given enough time. Our universe is expanding faster and faster, though, and if that behavior continues long-term then forget looping around, it's impossible to even "catch up" to some of the things we see.
So the universe may be infinite, and even in many of the models where it is finite it's still impossible for light to loop around.
