Is it permissible to write novels, and will the money earned from it be halal money?
In the Name of Allah, the Most Gracious, the Most Merciful.
As-salāmu ‘alaykum wa-rahmatullāhi wa-barakātuh.
In principle, it is permissible to write a novel so long as the narrative is based on a known event. It should not be a mere fantasy.
If the material does not have a well-established root or history and it is merely a tale, it must be beneficial and portraying positive messages and guidance.
If one writes an account of a known event, it will be disliked to add or delete occurrences to the episode.
With regards to the income accrued from such a profession, it will be Halāl if the written novel is of a permissible nature. If the novel is of a disliked nature, the subsequent income originating from the proceeds of selling such a book will also be disliked.
And Allah Ta’ālā Knows Best
Mufti Faraz al-Mahmudi,
 الْقَصَصُ الْمَكْرُوهُ أَنْ يُحَدِّثَهُمْ بِمَا لَيْسَ لَهُ أَصْلٌ مَعْرُوفٌ أَوْ يَعِظَهُمْ بِمَا لَا يُتَّعَظُ بِهِ أَوْ يَزِيدَ وَيُنْقِصَ يَعْنِي فِي أَصْلِهِ، أَمَّا لِلتَّزَيُّنِ بِالْعِبَارَاتِ اللَّطِيفَةِ الْمُرَقَّقَةِ وَالشَّرْحِ لِفَوَائِدِهِ فَذَلِكَ حَسَنٌ. (الدر المختار ج 6 ص 422 أيج أيم سعيد)