Your wav file is an array of [n] values. To calculate length of file in seconds you need to divide n by sr (sampling rate, number of measurements per second).
Be sure to provide sr value to librosa.load in case you have wavs from different sources because wavs can be recorded with different sampling rates and librosa will automatically resample them on load. Average len of y across all files, divide by sr.