Short answer
No, if you mean it as a kind wish that things go well, it is permitted. What is haram is believing that luck itself, lucky numbers, charms or omens bring good or harm apart from Allah. A better habit is to say in sha Allah, bi'idhnillah or 'May Allah make it easy for you'.
Saying 'good luck' as a wish for success is permitted, since people mean 'I hope it goes well'. Believing in luck as a force beside Allah, or relying on lucky charms and numbers, is haram and can reach shirk. Using Islamic phrases instead is better.
The four schools agree on this.
Explanation
The Prophet ﷺ said there is no tiyarah (bad omen), and he liked fa'l, a good word that gives hope. He also said tiyarah is shirk. So Islam rejects the idea that events are controlled by chance or signs, but it welcomes optimism and kind words that point to Allah.
When a friend says 'good luck in your exam', they usually mean 'I hope it goes well for you'. That meaning is fine. The words are only a problem when someone truly believes luck is a power that decides things, or ties luck to objects and numbers. What is not allowed:
- lucky charms, rabbit's feet, horseshoes, lucky shirts or 'lucky' bracelets;
- lucky numbers, lucky colours or lucky days (see numerology);
- 'knock on wood' or crossing fingers to keep good luck;
- bad omens such as black cats or the number 13 (see superstitions).
Better things to say:
- 'May Allah make it easy for you' or 'I'll make dua for you';
- Bi'idhnillah (by Allah's permission) or In sha Allah it will go well;
- Allahumma la sahla illa ma ja'altahu sahla, the dua for ease;
- Barakallahu fik when someone succeeds.
If a non-Muslim colleague says 'good luck', just thank them. It is a kind gesture. The four schools agree that believing in luck as a separate power is forbidden.
The evidence
Sahih al-Bukhari 5756
Sahih... لا عدوى ولا طيرة ويعجبني الفأل ...
"There is no contagion of itself and no bad omen, and I like optimism."
Omens are rejected and hopeful words are liked.
Sunan Abi Dawud 3910
Graded sahih... الطيرة شرك الطيرة شرك ...
"Taking omens is shirk, taking omens is shirk."
Believing in luck and omens is a form of shirk.
Where the ruling is recorded
- Fath al-Bari (Ibn Hajar), Kitab al-Tibb, chapter on fa'l. Explains the difference between optimism and taking omens.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.