Using Pythagoras theorem,
[tex]\sf a^2 + b^2 = c^2[/tex]
Where [tex]\sf a[/tex] and [tex]\sf b[/tex] are the two legs of the triangle, and [tex]\sf c[/tex] is the Hypotenuse.
Putting the given values:
[tex]\sf 5^2 + b^2 = 8^2 \\ \longrightarrow \sf b^2 = 64 - 25 \\ \longrightarrow \sf b^2 = 39 \\ \longrightarrow \sf b = \sqrt{39}\:\:inches[/tex]
Hence, the length of the other leg is,
[tex]\leadsto \underline{\boxed{\mathfrak{\pink{\sqrt{39}\:\:inches}}}}[/tex]