While both ~必要がある and ~なくてはいけない are used to express that something is necessary or must be done, they are both used slightly differently.
Take for example the following sentances:
コンピュータを再起動する必要があります。
You need to restart the computer.
コンピュータを再起動しなくてはいけません。
You/I/etc must restart the computer.
In the above sentances 必要があります
is less personal and has a more instructional tone to it. The message is actually what my Mac displays when it wants me to restart. In this scenario しなくてはいけない
wouldn't be appropriate, as it would sound demanding and impolite.
しなくてはいけない
has a more colloquial, personal tone to it, while 必要がある
emphasises the degree of requirement, and is more formal/polite. For example here is a sentence taken from the terms and conditions of a form I am currently filling in:
申請者ご本人を確認する必要があります。
We are required to verify the applicants identity.
Again, しなくてはいけない
wouldn't really work in this more formal written scenario.
Finally, if you take the examples posted by @yadokari above:
宿題をする必要があります
It is necessary that i do homework
宿題をしなくてはいけません。
I have to do homework
While both are fine, I doubt you'd hear many kids running around saying 宿題をする必要があります
, they would almost certainly use a form of 宿題をしなくてはいけません
.
As for the second part of your question, looking up the words in the dictionary gives a pretty good explanation.
必要[名・形動]なくてはならないこと。どうしてもしなければならないこと。
- Must not be without, Must be done / is necessary.
要る[動ラ五(四)]費用・品物・時間などが必要になる。入用である。
- Is needed, becomes necessary, mainly used with products, goods, time, money, etc.
The meaning of both 要る and 必要 are again very similar, as above there is a slight difference in the levels of politeness/formality. I would also say that 要る has a lesser degree of need than 必要 does.
For example:
新しいパソコンが要ります
I need a new computer.
The nuance of the above sentence would be that while your saying that you need a new computer, it may not be a requirement (Maybe your current computer works just fine, but it runs slow, and it would just be great if you had a new one).
While if you used ~必要です in the same sentence, it adds a greater degree of need to the statement, the computer becomes a requirement that you cannot do without (Maybe your computer is too slow to do what you want to do, or maybe it's broken, but the bottom line is that you must have a new computer to accomplish whatever it is you want to do).