It is during Battle of Banu Nadir. It occurred in Medina in 625 CE (4 AH)
The Banu Nadir بنو نضیر , a Jewish tribe, were using the thick fields of palm trees to their advantage, fortifying their castles and harassing the Muslims with stones and arrows
This incident is referenced in Quran 59:5
ما قطعتم من لينة أو تركتموها قائمة على أصولها فبإذن الله وليخزي الفاسقين
Every date palm that you [i.e., the Muslims] cut (and burnt) or left standing on its roots was by Allah’s permission and to humiliate the sinners. (Surah Hashar, Verse: 5)
and is also recorded in the Sahih al-Bukhari hadith collection.
The Prophet (sallallahu ‘alayhi wa sallam) had the date palm trees of the Banu Nadhir tribe burnt, and cut down at a place called Al-Buwayrah. Hassan ibn Thabit (radiyallahu ‘anhu) said in a poetic verse: “The chiefs of Bani Lu-ay found it easy to watch fire spreading at Al-Buwayrah.”
حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، حَدَّثَنَا جُوَيْرِيَةُ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ حَرَّقَ نَخْلَ بَنِي النَّضِيرِ وَقَطَعَ، وَهْىَ الْبُوَيْرَةُ، وَلَهَا يَقُولُ حَسَّانُ وَهَانَ عَلَى سَرَاةِ بَنِي لُؤَىٍّ حَرِيقٌ بِالْبُوَيْرَةِ مُسْتَطِيرٌ.
(Sahih Bukhari, Hadith: 2326)