From a material's name, automatically "fill it in", and have it point to a same-named image texture
Under the assumption, that you have one 'Image Texture' node in your material setup and all the image filenames are unique, it should be something like :

for material in bpy.data.materials:  
    #loops through all the materials
    mname = material.name            
    #get the name of the material
    img_fname = "{}.png".format(mname) 
    #get mname.png
    img_full_path = "path/to/image/files/{}".format(img_fname) 
    #get path to image, including the image
    bpy.data.images.load(img_full_path, check_existing=True) 
    #load the image to the internal database
    material.node_tree.nodes['Image Texture'].image =bpy.data.images[img_fname] 
    #assign image by filename to material image texture input


You need to work out the path to the image files. Best to open the python console and try to load one image manually, using the

bpy.data.images.load()


command, then insert the base path that worked. 

Edit: img_fname was in quotation marks in bpy.data.images. That would not have worked.