It was narrated from 'Abdullah bin Mughaffal that the Prophet (ﷺ) said:
"Whoever digs a well, is entitled to forty forearms' length surrounding it is as a resting place for his flocks." (DE)
English reference (DE): Vol. 3, Book 16, Hadith 2486 (DE)
Arabic reference (DE): Book 16, Hadith 2580 (DE)