He's likely referring to the Battle of Chamkaur in 1704, where the Khalsa (the name for the Sikh army), led by Guru Gobind Singh had encountered a large Mughal army led by Wazir Khan and various Generals. The Sikhs did not defeat the Mughals, though, and instead most of them died. Some Sikhs, including Guru Gobind Singh had escaped the battle.
The 40 v ten-thousand comes from the Guru's personal letter to the Mughal emperor Aurangzeb, called the "Zafarnama". In it, he recounts that the Emperor had laid an oath on the Quran to not attack, and that had he known, he would not have entered Chamkaur.
" What can forty hungry men do, when suddenly ten-lac strong army pounces upon them? "
This is the verse that puts the numbers down. I'm pretty sure that the ten-thousand is metaphorical, and simply to denote that it was a massive number compared to the 40. Remember, this is poetry too, and literary devices are prevalent. However, seeing as there were 4 or more Generals and the Governor of Sirhind, we can assume that it was a pretty big army - no small army would need so many high-ranked individuals. One letter from a Persian source states that a commander with an army of 700 cavalry and an amount of artillery was sent to Chamkaur against the Guru.
Regardless, the 40 Sikhs did not defeat the Mughals. Your friend might be confusing multiple stories into this one thing. In other occasions, the smaller Sikh armies thwarted Durrani invaders multiple times.
Sources: