While both a restraining order and a no contact order mean you have to stay away from a particular person, they are still very different. A restraining order is civil and it’s own separate case against you, where as a no contact order is pursuant to a criminal case against you.
Let’s say you have a domestic violence charge against you. That is a criminal charge, and the judge is most likely going to issue a no contact order. The longest it can last is for the duration of the case plus 12 months of probation after the case is over.
A restraining order is a separate action altogether. If someone files a restraining order against you and the judge grants it, it can last for as long as the judge decides—even if that means forever.
Another important difference to note is that with a no contact order you don’t lose your access to guns, where as if a restraining order is granted against you, you are no longer able to have any guns.