The ones I've gotten stuck on are always the ones where I didn't put enough thought or effort into the initial composition and layout, and now they just lean against the wall collecting dust. Once I threw out about 10-15 half done works that I just hated. I usually don't do that but I was moving overseas and I wasn't about to ship them.
Every artist has some duds sitting around, don't let it get to you too much. Consider it a learning experience.
Sometimes (at least for me) a painting isn't always meant to be finished. The spark to create it is there, and then it's gone, and sometimes there's no hope in getting that spark back. I have a few canvases stacked in my closet of old paintings that just don't speak to me anymore. With those I sometimes pull one out and rework it a few months later to turn it into something new, or I just gesso over it entirely and start from scratch.
Or, I just turn the painting upside-down or sideways and work that way to see if it stirs any new inspiration haha.
Usually when I get stuck on a painting I just kinda ignore it for a few days. Being a student I unfortunately don't really have the luxury to just abandon a painting for months at a time, so after a few days I just look at it. I objectively study it and try and figure out what it is exactly that is bothering me so much about it and make the necessary changes. Getting feedback from other artists can help you to see what you may not, and thus help you more with your art-block.
I have to agree with everyone here. When I get stuck I usually abandon the piece for some time (sometimes years) until one day I stumble upon it and get that "a-ha!" moment. If I'm REALLY stuck I bust out the gesso for a complete redo. I used to believe that if I didn't finish a piece in an "appropriate time" then it was "dead" but this isn't true. A painting can go on and on and on... I try to work on a few pieces that way when one is irritating me I can move to something else (or play video games heheh.)
Grumble, look at it, try to love it -usually I get stuck when I don't like it much-, put it 3m from me and pace up and down smoking looking at it -must stop smoking bleh- then depends if i think its going well n Im stuck I try taking it up the next day or if I think Ive been doing crap I make a big smudge over it and start over.
A week later if its not finished its dead.
I just started painting last year though so big newbie