I found this GIF on the internet, and I was kinda shocked. Does anyone know if this was really said in the anime? And if possible if you could tell me the season and episode?
No, that dialog is made up. I saw the BL joke somewhere on the internet and while Kise's ankle/knee did bother him during the game, I'm not sure that shot from the image you posted is even from that game. The entire game is from the 1st season and I think it spans a few episodes:
that cover the match between Toho Academy (Aomine, from your picture) and Kaijo (Kise).