How to 'scale' a texture image to the object
I am going to guess that you created a cube, stretched it along one axis, and then added a wood texture, something like this:  (I used a different wood texture but the idea is the same.)



You can tell whether you applied the scale by looking at the sidebar in object mode:

in this example I scaled Y by 10 but didn't apply the scale.  In object mode, CTRL-A brings up the apply menu.

Selecting scale fixes the scale:

But that doesn't fix the problem because you still have the default UV Map that was created when the cube was created.  So you need to create a new UV Map.  Here's the quick way to do that:
In edit mode, select all of the vertices of your rail.  Then use CTRL-E to bring up the edge menu.

select &quot;Mark seams&quot;.  Your beam will now have red edges to indicate that ever edge is a seam:

Next you have to unwrap the beam.  Because all the seams are in place you can use the shortcut U-key U-key (typing U twice.  That'll give you a UV map that looks like this one more or less:

For me, this isn't enough, because the grain of the wood in the photo runs 90 degrees to the way wood would be cut for a beam.  To fix this I needed to rotate the UV map.  This is done by going into the UV edit window and then using the rotate and move tools to reposition the map.
The shortcut for this is 'a r 9 0 RETURN' to rotate and then 'g' to move.  left click to exit move -- this works just like in the 3d viewport


once that's done, my beam looks like this:

There is a lot more to UV unwrapping, like why I unwrapped each face separately, and other ways to manipulate the UV islands, but this answer is getting long.