Will the atma get moksha if a person dies in unnatural ways such as suicide, murder, etc?
No, the atma will not get moksha by such deaths. The default rule is, a person dying such unnatural death as suicide, weapons, etc. will become a ghost:
udbandhanamṛtā ye ca viṣaśastrahatāśca ye
ātmopaghātino ye ca viṣūcyādihatāstathā [GP - 2.22.8]
One who dies by hanging, also through poison and weapon, one who commits suicide and also dies by cholera etc. becomes a ghost.
The Gardua Purana chapter 2.40 describes many more such untimely deaths upon which one can go to hell or become a ghost. Some of them are, death by strangulation, who fall from peaks, whose bodies are not properly cremated, who are defiled by jackals, dogs and worms, who die of terrible disease and so on.
Generally, such kinds of death are considered to be results of past sins. So the chapter 2.44 of Garuda Purana says in the first three verses who die out of suicide, animals, reptiles, water, poison, etc. are said as great sinners.
However, what will happen after death, whether a person will enter permanent ghosthood or not, etc. are dependent upon the action of the jiva while he was alive (svaiḥ svaistu karmabhiḥ prāptaṃ pretatvaṃ - [GP - 2.2.33]). So the scripture says God redeems such a soul and gives moksha if he had done devotion and remembered Him always while he was alive:
baddhaḥ parikarastena mokṣāya gamanaṃ prati
kṛṣṇakṛṣṇeti kṛṣṇeti yo māṃ smarati nityaśaḥ [GP - 2.38.8]
I give moksha to that bound soul who always remembers Me as Krishna, Krishna, Krishna.
So even though the natural and default outcome of such unnatural deaths is hell and pretavta (ghosthood), through devotion and remembrance of God one may get rid of it. After all, what next state the jiva will attain solely depends upon the last thoughts in his mind. So the Gita says:
Whatever state of being one remembers when he quits his body, O son of Kuntī, that state he will attain without fail. [BG - 8.6]
And whoever, at the end of his life, quits his body remembering Me alone at once attains My nature. Of this there is no doubt. [BG - 8.5]
That is why yogis, even though die at their own will, do not get bound by such laws. They fix their mind upon God and willfully discard the body. But for common people like us, it is very very difficult to remember God while dying because emotions of all kinds, pain and fear of all kinds will take over our mind. Hence, saints and sages suggest to practice remembrance of God always so that it will be easier for us to remember Him while leaving the body.
- ShishupAla & Kansa got killed by Krishna
- Krishna was killed by hunter Jara
- RAvana was burnt alive by RAma
- RAma, Drona & Bhishma gave up their bodies
But all are believed to have attained Moksha. As rightly stated in this comment, there is No specification for who will get Moksha.
Rationally, if the "Moksha" is beyond the material world, how will the material world rules matter to attain it!? During Gita, Krishna has mentioned many times, that even the most sinner person should be considered SAdhu, if he has plugged his mind in "Me"/Self.
There are certain "hints" during death time, to let know if the soul has liberated or not.
How can we know that an Aatma got Moksha?.