I know what you are going through. Trust me you are not worthless and this person's opinion DOES NOT define you. It doesn't mean you're not cut out for CS. I know that's hard to see now being your first job, but one day you will move past this
My first job out of college wasn't in tech, but another technical field. I was basically told by my manager that I was incompetent and talked down to constantly, timed to do math problems on the board (yes really), until I shell of my former self and believed myself to be an idiot. Eventually I was let go and it was the best thing to ever happen to me. By the end of my employment, I had to go through therapy to get out of the mental hole it put me in. Fast forward to today, and I've had two tech jobs and nobody has told me i'm incompetent. If you had asked me 2 years ago, I thought that I was worthless and would never be able to work in a technical role. Trust me, those feelings that you have right now are not true.
It's up to you to really decide if it's worth the lines on your resume and the extra money. But if your financial situation permits it I would definitely consider leaving especially it is affecting your mental health. It doesn't sound like a great place to learn anyways. And honestly you might be better off just spending the summer learning on your own than being beaten down constantly.