Factorio has a defined ending which is launching the rocket. Many people play to that point and then stop. It doesn't take that long to get there though as long as you don't get too distracted with efficiency.
The endless part is that launching the rocket is a necessary step for acquiring the endgame science pack, which unlocks the handful of endless research tracks. From that point on the entire game is focused on improving efficiency.