A square $ABCD$ is divided into $(n - 1)^2$ congruent squares, with sides parallel to the sides of the given square. Consider the grid of all $n^2$ corners obtained in this manner. Determine all integers $n$ for which it is possible to construct a non-degenerate parabola with its axis parallel to one side of the square and that passes through exactly $n$ points of the grid.
1. **Coordinate System Setup**:
   Place the square \(ABCD\) in the coordinate plane such that the lower-left corner is at \((0,0)\) and the upper-right corner is at \((n-1, n-1)\). This means the square has side length \(n-1\) and is divided into \((n-1)^2\) smaller congruent squares, creating a grid of \(n \times n\) points.

2. **Parabola Assumptions**:
   Assume the axis of the parabola is vertical. A vertical parabola can be described by the equation \(y = ax^2 + bx + c\). We need this parabola to pass through exactly \(n\) points of the grid.

3. **Intersection with Vertical Lines**:
   For the parabola to pass through exactly \(n\) points, it must intersect \(n\) vertical lines at distinct points. Since the parabola is non-degenerate, it can intersect each vertical line at most once.

4. **Symmetry and Distribution**:
   Let \(k\) be the floor of \((n+1)/2\). This means \(k\) is the greatest integer less than or equal to \((n+1)/2\). We can assume the right side of the parabola contains at least \(k\) lattice points. 

5. **Arithmetic Progression**:
   The vertical increments of a parabola form an arithmetic progression. The highest lattice point contained in the parabola has a vertical coordinate of at least \(1 + 2 + \cdots + (k-1) = \binom{k}{2}\).

6. **Inequality Constraints**:
   We need \(\binom{k}{2} \leq n-1\). The binomial coefficient \(\binom{k}{2}\) is given by:
   \[
   \binom{k}{2} = \frac{k(k-1)}{2}
   \]
   Therefore, the inequality becomes:
   \[
   \frac{k(k-1)}{2} \leq n-1
   \]
   Simplifying, we get:
   \[
   k(k-1) \leq 2(n-1)
   \]

7. **Solving for \(k\)**:
   We need to find the maximum \(k\) such that \(k(k-1) \leq 2(n-1)\). Let's test values of \(k\):
   - For \(k = 4\):
     \[
     4(4-1) = 12 \leq 2(n-1) \implies 12 \leq 2(n-1) \implies 6 \leq n-1 \implies n \geq 7
     \]
   - For \(k = 5\):
     \[
     5(5-1) = 20 \leq 2(n-1) \implies 20 \leq 2(n-1) \implies 10 \leq n-1 \implies n \geq 11
     \]

   Since \(n\) must be an integer, the maximum \(k\) that satisfies the inequality is \(k = 4\), which implies \(n \leq 8\).

8. **Verification for \(n = 8\)**:
   For \(n = 8\), we can construct a parabola passing through the following lattice points: \((0,7), (1,4), (2,2), (3,1), (4,1), (5,2), (6,4), (7,7)\). This parabola intersects exactly 8 points of the grid.

Conclusion:
The only integer \(n\) for which it is possible to construct a non-degenerate parabola with its axis parallel to one side of the square and that passes through exactly \(n\) points of the grid is \(n = 8\).

The final answer is \( \boxed{ n = 8 } \).