I am sure if they mean the same. If there are some differences between them, what are those? When and how to use each of them? Thanks.
They don't mean the same.
"你去干嘛?" means "What are you going to do?" or maybe "Why are you going?" depending on the context.
"你去吗?" means "Are you going?"
A: 我出去一会 = I'm leaving for a while. B: 你去干嘛? = What are you going to do?
A: 我去开会了 = I'm going to attend the meeting. B: 这会是给经理开的, 你去干嘛? = The meeting is intended for managers. Why are you going?
A: 我要去吃午饭, 你去吗 = I'm leaving for lunch. Are you going (with me)?