I'm going to answer your questions one by one.

1) In what context is it used? It's used in two different ways: The first is used as the English word "twins", the second one is used in order to express a strong friendship with someone. The logic behind why the second meaning arose is simple: you are such good friends that you might as well be twins (because of the strength of a relationship with a twin).

2) Is it slang? No, since the word is defined by the RAE (Real Academia Española) it is an official word in the Spanish language.

3) Origin: Cuate comes from the language nahuatl and the word "cóatl", which means snake ("serpiente") or twin ("mellizo").

I'll attach you the link which contains the information: http://dle.rae.es/?id=BU52usF

I really hope it helps you.