Copyright is fairly recent phenomenon when compared with the age of the Quran and hadith.
Copyright came about with the invention of the printing press and with wider literacy .... Charles II of England was concerned by the unregulated copying of books and passed the Licensing of the Press Act 1662 by Act of Parliament
Hadiths are not copyright to the Prophet (saww) because they are recorded history and traditions. More like a biography. The authors of those biographies could have claimed copyright on it. But as far as we know they have not done so nor is it likely that the copyright would be intact given their age. Copyright of Quran from a religious perspective could belong to Allah, who has sent it down for the guidance of mankind, and from an areligious perspective it belongs to no one (treated like the biography of the Prophet).
Temporally (not sure if that's the correct word) speaking even if the Quran and hadith were copyrighted they are old enough that their copyrights are very likely to have expired.
Typically, the duration of copyright is the author's life plus 50 to 100 years
Does anyone know if prayers or religious texts are subject to copyright law?
Generally these are public domain if they are old enough; ...
A person can however charge you for providing the copy of Quran (or any Ayat or Surah) or Hadith. But they cannot stop you from redistributing it, and only it.
But works of translation, tafser and other educationals text can be copyrighted and the author(s) can restrict its redistribution, copying etc as per their copyright.
Same comment continued:
... however, it is necessary to be cautious as each translation has a copyright. The NIV for example is copyright protected. So it would be necessary to determine which translation the prayer and/or bible verse is in.