There are quite a few possible answers. Specifically:
There are 24960, out of a possible 362880 squares (ignoring the fact that you could consider two squares to be the same if rotated/flipped).
The first one, lexicographically sorted is
1 2 3
4 5 8
6 9 7
and the last one is
9 8 7
6 5 2
4 1 3
I arrived at the answer by writing a script in Python 3 that checks every possible option:
import itertools
matches = 0
for square in itertools.permutations(range(1, 10)):
sums = set()
# rows (sum consecutive groups of 3)
sums.add(sum(square[0:3]))
sums.add(sum(square[3:6]))
sums.add(sum(square[6:9]))
# columns (sum every third element, starting at a different position for each column)
sums.add(sum(square[0::3]))
sums.add(sum(square[1::3]))
sums.add(sum(square[2::3]))
# diagonals (summing diagonals is trickier to explain, but the following works)
sums.add(sum(square[0::4]))
sums.add(sum(square[2:7:2]))
# the length of a set is the number of unique elements.
# if we have 8, then each sum is unique.
if len(sums) == 8:
matches += 1
print(matches)