The length of the DataLoader gives you the number of batches, while the length of the Dataset is usually defined as the number of samples.
If you are writing a custom Dataset, you are setting the length in the __len__ method, so that’s why I said “usually”.