That's not the simplest question in the world.
There are also a number of ways you could look at it.
Legally: Yes, it is wrong. The law doesn't make distinctions between many things. Ultimately, legally, if you kill someone, or help kill someone, you have done wrong.
Morally: That's where the big debate lies, isn't it? Doctors sometimes use the Q-TWiST scale (Quality adjusted time without symptoms or toxicities) to advise patients as to whether further treatment is advisable or whether the patient should abandon hope and just submit to pain-easing palliative care while they wait for death. To my mind, once all reasonable scales of measure indicate that it's hopeless that you will recover and, additionally, that you don't have much time left and also, that what time you have left will be a horrible descent into constant increasing pain as your body breaks down and your family watches in horror, assisted-suicide, or even straight suicide is not something that is unreasonable.
People should be able to save their dignity and not have to suffer unecessarily. Beyond that, a person who is truly determined to commit suicide will. Better that they are helped so a) they can do it as painlessly as possible, b) they can actually guarantee that they WILL die (which sounds harsh, but is kinder given they're at that point) and c) they can (and I mean this unironically) do it safely.
But that's all really referring to people who are suffering from terminal illnesses.
You also asked about the elderly and people who are brain dead and in those cases:
Both of those refer to a financial burden and that is absolutely not a reason to commit suicide or to have someone help you commit suicide. The financial burden is taken on by the elderly person's children and/or grandchildren and that is a burden they gladly take (or begrudgingly take) because they love their grandparent or parent. Just because the elderly person feels that the money shouldn't be spent is not a reason to END THEIR LIFE. Ending their life in that case is incredibly selfish. You're taking a parent or grandparent away from people for no reason aside from your own pride or guilt. That's pretty unbelievable.
Now, if your children or grandchildren are wildly resentful at having to pay for you, you may wish to alleviate their burden, but the method still should not be suicide.
In the case of a brain dead individual, once again, the decision as to whether or not to pay for the palliative care lies with the family. A brain dead individual obviously cannot decide for themselves, so what you are really asking is: Is it wrong for a family to "pull the plug" on a brain dead individual? The answer is, "It depends on how you define 'Brain Dead.'"
Brain dead as in: Coma due to swelling/brain damage where there is a chance, however remote, that there may be a recovery?
Brain dead as in: If there weren't machines pumping his lungs/heart etc, he'd be dead?
The first one, yes it is wrong. The second one, not so much.
Ultimately, this question, in many ways, comes down to personal choice. Obviously, if there's a chance someone will recover, you should attempt to exhaust all available resources trying to facilitate that recovery. Not at the expense of your own life or the life of another, of course, but certainly a financial burden is not a great thing. It's only money. And yeah, it's frustrating and a big deal, but still, it's only money and you're saving a life (maybe). Having someone killed when there's a chance they might recover is terrible.
On the other hand, if someone is dead in every sense but bodily functions, that's a lot tougher to justify. In cases of true brain death, there has never been a recovery. That's what death means. In this case, why would someone extend the physical existence of a person who is dead? That strikes me as being obsessive, strange, unhealthy behaviour. You have to accept that the person is dead, even though they're breathing, and try to move on. Keeping their body in a breathing stasis while the brain has died is not something I would advocate, and in that case, pulling the plug can, and maybe should be a viable option.
For myself, while generally I consider suicide to be a horrible selfish act, if I was in the final stages of a wasting illness and nothing was before me but a downward spiral into agony and medicine, I would seriously consider suicide, but I would probably talk to my family and friends one at a time first.