You can't use the present tense with "since" in this context (this is different from many other European languages, e.g. French, where you would use the present tense, so it is a very common error for non-native speakers to make)
"Since when have you been friends with him?" would be grammatically correct, but I'd probably say "How long have you been friends with him?" (to which "For 5 years" or "Since 2012" would both be perfectly good answers)
You can generally only use "since" when something is (or was) still ongoing, so you could only use "since" in the second sentence if you write "Since when had you been friends with him (at the time he died)" but that still sounds a bit awkward - I think it would be much more natural to say "How long were you friends with him (before he died)?" or "How long had you been friends with him (up to the time he died)?"
I hope that helps - if it's not completely clear, feel free to add a question in the comments.