A cube with edge length $3$ is divided into $27$ unit cubes. The numbers $1, 2,\ldots ,27$ are distributed arbitrarily over the unit cubes, with one number in each cube. We form the $27$ possible row sums (there are nine such sums of three integers for each of the three directions parallel with the edges of the cube). At most how many of the $27$ row sums can be odd?
1. **Understanding the Problem:**
   - We have a cube with edge length 3, divided into 27 unit cubes.
   - The numbers 1 through 27 are distributed over these unit cubes.
   - We need to find the maximum number of row sums that can be odd. There are 27 possible row sums (9 sums for each of the three directions parallel to the edges of the cube).

2. **Analyzing a 3x3 Square:**
   - Consider a 3x3 square. For all six row sums (3 rows and 3 columns) to be odd, the number of odd numbers in the square must be 3, 5, or 9. This is because:
     - A row sum is odd if and only if it contains an odd number of odd numbers.
     - If there are 3 odd numbers in a row, the sum is odd.
     - If there are 5 odd numbers in a row, the sum is odd.
     - If there are 9 odd numbers in a row, the sum is odd.

3. **Extending to a 3x3x3 Cube:**
   - The cube consists of three 3x3 layers.
   - We need to consider the row sums in three directions: along the x-axis, y-axis, and z-axis.
   - For each layer, the number of odd numbers must be 3, 5, or 9 for all row sums in that layer to be odd.

4. **Counting Odd Numbers:**
   - There are 14 odd numbers (since there are 27 numbers in total, and half of them are odd, rounded up).
   - We need to distribute these 14 odd numbers among the three layers such that the number of odd numbers in each layer is 3, 5, or 9.

5. **Partitioning 14 Odd Numbers:**
   - The possible partitions of 14 into three parts from the set {3, 5, 9} are:
     - (3, 5, 6) - Not possible since 6 is not in the set.
     - (5, 5, 4) - Not possible since 4 is not in the set.
     - (9, 3, 2) - Not possible since 2 is not in the set.
   - Therefore, it is impossible to partition 14 odd numbers into three parts where each part is 3, 5, or 9.

6. **Conclusion:**
   - Since it is impossible to partition 14 odd numbers into three parts of 3, 5, or 9, there must be at least one even row sum in each of the three directions.
   - This restricts the total number of odd row sums to at most 24.

7. **Example Configuration:**
   - Consider the following configuration:
     ```
     ooo oxx oxx
     ooo xxx xox
     ooo xxo xxo
     ```
     - Here, "o" represents an odd number, and "x" represents an even number.
     - Only the three rows containing the center of the cube have even sums.

The final answer is $\boxed{24}$.