Question: My PhD supervisor (in the field of artificial intelligence) invited me to several meetings with another PhD student. Since I have more knowledge than my supervisor in some topics, I made many suggestions about how this student could improve his methodology. In total, I went to 5 meetings of 3–4 hours each. I could have used this time to do my own research.

When the other student started to write his manuscript, I asked to be an author, since I had contributed directly to the research, but he felt I only deserved to appear in the acknowledgments. So I asked my supervisor to be on the paper and even volunteered to help writing it. My supervisor said “Don't worry about his paper, you have your own things to do, and he is not going to submit this work anytime soon”.

One week later, they submitted the paper to a major conference without my name on it. I felt really insulted that they used my time and skills with no credit to me.

I didn't actively do the research or help write the paper, but I felt I was supervising the student since I have the most experience on this topic. Many academics in my field get their names on papers by just giving suggestions.

What should I do? I am planning on taking it to the head of department.

Answer: 
The other answers cover most of the points but I’d just like to add that submission doesn’t necessarily equate with acceptance. They may have rushed this paper slightly to meet a conference deadline and neglected you in the rush to submit. They may be planning a journal submission after the conference and would like to collaborate with you on this. The supervisor/student may have decided to "take a punt" on this conference, knowing that the paper will be reviewed quickly and that reviewers' comments will be useful even if it is a likely rejection.

Bottom line: don’t take it personally. Consider if you **want** an authorship on a paper that you have had no direct control over.
It's possible that your supervisor and your cuckoo think that you don't deserve co-authorship because they didn't let you edit the paper before submitting it. But the amount of time you spent providing needed advice and guidance in my opinion deserves more than a mere acknowledgement.

That said, raising a stink about this paper isn't going to be helpful to you. You need to finish your own degree, and making an ennemy of your advisor is not the way to get there. In addition, most department chairs are not real managers, and all they'd do with such a request is flee, not try to help you over the opinion of their colleague. So you should probably just let this slide, and maybe try to get an acknowledgement in the final published product.

But you should also pay attention to what this incident says about your advisor. Pursue every possible opportunity to publish with other people! If possible far-away people who don't have any institutional links with him. Be very sure that all help you provide him in your field of expertise will bring you at least co-authorship on whatever the project is, negotiating that up front. Make sure he doesn't just suck you dry for the duration of your studies. Don't outright refuse to cooperate, but be vague and unavailable if necessary.