Both translate to classmate. However I can't see in which context one is used. I asked to my teacher and he said that he never heard about 級友 and it might be an old word not used anymore. What is the truth ?
同級生 doukyusei literally means "same grade student" while 級友 kyuuyuu literally means "class friend" (or as the British might say, "school chum" ? maybe?) ... In the sense that English does not have a single word that combines the concepts of someone from the same grade or class who is also specifically your friend, the closest possible one-word translation would of course be "classmate". I have never run across the word kyuuyuu in my daily conversations with Japanese teachers or students, so I can only speculate that it may have fallen out of favor, conversationally, at least. 同級生 is something I hear on a weekly basis, almost. If I was going to write or speak about someone's classmate in Japanese, I would use 同級生 every time. In fact, I have heard people say the phrase "同じ学校の友達" on more than one occasion, which should tell you just how unpopular 級友 is, as a word choice. I would not be too surprised to see the word in print, because it would be totally readable and instantly understandable, but in spoken Japanese, no, it is not common.