Let the speed of the stream be \( x \) km/hour. The speed of the boat upstream will be \( 18 - x \) km/hour, and the speed of the boat downstream will be \( 18 + x \) km/hour.
The time taken to go upstream is:
\[
\text{Time upstream} = \frac{24}{18 - x}.
\]
The time taken to go downstream is:
\[
\text{Time downstream} = \frac{24}{18 + x}.
\]
According to the problem, the time taken to go upstream is 1 hour more than the time taken to go downstream:
\[
\frac{24}{18 - x} = \frac{24}{18 + x} + 1.
\]
Subtract \( \frac{24}{18 + x} \) from both sides:
\[
\frac{24}{18 - x} - \frac{24}{18 + x} = 1.
\]
Simplify the left-hand side:
\[
\frac{24(18 + x) - 24(18 - x)}{(18 - x)(18 + x)} = 1,
\]
\[
\frac{24(18 + x - 18 + x)}{(18 - x)(18 + x)} = 1,
\]
\[
\frac{24(2x)}{(18 - x)(18 + x)} = 1.
\]
Simplify further:
\[
\frac{48x}{324 - x^2} = 1.
\]
Multiply both sides by \( 324 - x^2 \):
\[
48x = 324 - x^2.
\]
Rearrange the equation:
\[
x^2 + 48x - 324 = 0.
\]
Solve this quadratic equation using the quadratic formula:
\[
x = \frac{-48 \pm \sqrt{48^2 - 4(1)(-324)}}{2(1)} = \frac{-48 \pm \sqrt{2304 + 1296}}{2} = \frac{-48 \pm \sqrt{3600}}{2} = \frac{-48 \pm 60}{2}.
\]
So:
\[
x = \frac{-48 + 60}{2} = \frac{12}{2} = 6 \quad \text{or} \quad x = \frac{-48 - 60}{2} = \frac{-108}{2} = -54.
\]
Since the speed of the stream cannot be negative, the speed of the stream is \( x = 6 \) km/hour.
Conclusion:
The speed of the stream is \( 6 \) km/hour.