I would never ever recommend that you stop learning a piece! EVER!
There is something that you need to learn in each and every piece you study. Something about yourself, something about your internal growth and your skills.
That being said, when you have truly given your BEST effort, sometimes you are just not ready. Maybe not now, but down the road.
Has this happened to me. YES! My teacher and I spent months..probably 4-5 months working on the first page of a Mozart Sonata. The first page! They are huge!! At least 23 pages long..and the first page was a challenge. My teacher worked very very hard to help me, but I was not ready. So..it was Beethoven for me! Did I study Mozart..Yes!! Years later when I was ready!!
Never give up…even if you are not ready right now. That time will come! It always does if you have a burning desire and persistence!!