By default most materials that are not abstract and have patterns like a brick wall or a tiled floor use UV as the coordinate to map the material, but you can always replace that vector to fix stretching like in this case:
We have a stretched texture because the plane is 4 times larger on X axis than on Y axis
To fix the ratio we replace the coordinates with a UV map using mapping with X scaled to 4
On some abstract materials using generated coordinate you will find Shape Ratio parameters to adjust stretching. Like on this gem material where the object is 3 times larger on Z axis than on X and Y.