I am a final year Ph.D. student and will graduate soon. My advisor is still asking me to run problems instead of publishing any paper on the work that I have already done over the last few years. I will be joining a postdoc after I graduate and he says I should keep working on these problems on the side after I graduate. Can someone please suggest me how to stay motivated.
I don't know what sort of hold the advisor has over you. Perhaps you are in a field that "requires" that he be a co-author on your work.
After you graduate, assuming that your postdoc is elsewhere he would seem to have little control over your actions.
But, if it is really just motivation that you want to maintain, you can always write the papers and see what you have. Even if custom prevents you from publishing now, it won't always and it might also serve to bring your thoughts together.
After you graduate and move on, your relationship to the advisor will also change and you should have more authority over your own actions.
I realize that this advice is somewhat optimistic and my field may be different enough from yours that it is inadvisable. But, my view, is that you should be treated with more respect.
Have you written the papers and the advisor stops them from going out? Or are you arguing about this before writing them? In general, in any situation like this, you are better off to write the thing up and then have the argument. (Not just academia, but requests for money, etc. I learned in the military that it's easy for your superior to say nobody gets leave...but it's harder on him to have to disapprove the leave chit.)
For one thing, maybe his opinion changes when the paper is all wrapped up in a neat little bow, and all he has to do is sigh off. For another thing, maybe you decide to send it in without his OK. (Not saying to do this immediately...just it is an OBVIOUS option down the road. And heck, having it written, puts that option in the back of his head even without you mentioning it.) \
In any case, don't have theoretical arguments about publishing, when you haven't even written what would be published!
Note that the work of writing things up is not lost even if the holdup remains. You need to clarify your thoughts. Also it is good practice for you. Based on your question, I think you need to work on your written communications in English. (Just a guess...and my grammar sucks...but you were missing a preposition in last sentence.) No offense if you are a non-native speaker...your English is likely much better than my whatever. Just that's the game you are in now...good writing of English language papers is a key attribute of a scientist. This is a perfect chance to work on fixing that. Helps remove a potential blocking factor (dependence on others for clear writing) and positions you to be an independent researcher.
In addition to writing technical English, it is good for you to get some practice being the moving force and positioning things for the literature. You should decide what journals to go to and how to carve your work up into different publishable parts. I recommend decent journals (1-2 ranks below Science/Nature, but NOT 3, nothing that requires page charges or is flybynight crap. Professional societies ACS, APS, are usually good.) For division, I recommend LPUs. (Look it up.) Make sure you get a copy of the notice to authors and follow it religiously. Write the thing so that it is perfect and needs no editing by an advisor or editor...just typesetting into the journal. Word is fine in most fields and even preferable to LaTEX. But if it is a journal that requires LaTEX, do that.)
Don't work on this guy's stuff after you leave. But don't have a useless argument about that, NOW. Just leave and THEN don't do it. Once you are gone and funded elsewhere, your negotiating position becomes a lot stronger. He will likely realize that 3/4 of a loaf is better than none. IOW write up the results to date and get a decent paper (but lacking some things he'd like) because otherwise he gets nothing, no paper.