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." (AR)
English reference (AR): Vol. 3, Book 16, Hadith 2486 (AR)
Arabic reference (AR): Book 16, Hadith 2580 (AR)