It is best if everyone playing the game agrees on what the exact victory conditions are before starting the game.
You could play a game so that when a player emerges as the most powerful and no other player has any hope of winning the players can call the game.
You can play a timed game. Set a date when the game will end. The player with the highest score at that date is declared The winner.
The score is based on the number of planets, ships and starbases that you own. Here is a break down of the points for each item owned.
Freighters : 1 point each
Planets : 10 points each
Capital Ships : 10 points each
Starbases : 120 points each
You may also have the REF.EXE program decide the winner.