If you're asking about Esri geodatabases, arcpy.ListFeatureClasses does exactly this given an input workspace (e.g. geodatabase connection).
The code (Python 3) from their example:
arcpy.env.workspace = "c:/base/gdb.gdb"
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else 
The arcpy.ListRasters() function will give you a list with the filenames of all the rasters in a given workspace. This way, you can specify the first GDB as your workspace and get a list of all the rasters in it. Then, you can repeat this process for the second GDB.
CVR = r"C:\Aquifer_recalc\Aquifer_recalc_NA\Treecover_NA\Treecover_Inputs.gdb"
LSS = r"C:\...