What are your obligations when charging by the hour vs charging by project?
Essentially the same. Be professional.
If you agree to take on a project, give a rough estimate that it might take 10 days for you to work on and charge £X per hour - are you obligated to work for free after those 10 days are up and you have still not managed to complete your project due to unanticipated issues?
No - as long as it's roughly 10 days, then you're fine. I would define roughly 10 days as anywhere between 50 - 120 hours at the extreme edges. Anything over 120 hours (a 50% overrun) is pretty much beyond the pale.
Though "unanticipated issues" leaves a lot of vagueness. Experienced professionals anticipate a lot more issues than new developers. However, if the client knows you are a new developer (and know they are getting a significant discount because of it) then there's some wiggle room here.
What if you have delivered the project but bugs are found - should you fix these bugs for free if the 10 days are up or should you charge your client?
Bugs? Yes - you should fix those for free. You're not being paid for 10 days to produce broken code.
Now, again, "bug" is a bit vague. There are show-stopper bugs (like, program doesn't run - obviously your fault) and edge-case bugs (program truncates text on Turkish-localized Windows with Chinese IME enabled - not really reasonable). Most fall somewhere in the middle, but the burden of proof is on you.
There's also specification bugs - these are the hardest. You'll have to use your judgment as to whether you should have reasonably anticipated, questioned or implied the specification change. Again, I'd put the burden of proof on you.
For a 10 day (80 hour) project with a green developer, another 10 - 15 hours of bugfixes wouldn't be too much to ask. Anything over that, I would try to work out payment for - though I'd probably do another 5 to 10 hours for free before firing the client.
Also, for the above project, what should be the result when you start on the project, but after the 10 days for whatever reason you have to give up and tell your client that you cannot do it anymore? I realise that this does nothing to build your reputation and relationship with the client but are you obligated to pay back the money paid to you or do you just deliver the half/nearly completed source code and help them find someone else to complete it?
You give the money back. If you can't finish the project, it's likely you can't judge half-completed. If the client hired you, it's even more likely they can't judge half-completed. If you can find someone else to finish it, you can subcontract to them - the difference in what they charge you and what you already made is your profit (or loss).
In the end, it's often better to bend to the client and chalk it up as a lesson learned. After a while, you'll be able to spot the "problem clients" and avoid them (or upcharge them) at the beginning. You'll also learn to estimate a bit better, build bugfix costs into your pricing, etc.
As a student developer, you do have some leeway. No one is likely to sue you over the pittance you charged for a 10 day project. You'll never get any business from that client (or his friends) again - but, since they hired a student developer, it's likely they only want cheap labor and don't understand what it actually costs to hire a good developer anyway. You're not losing out on much in the future except headaches - though at the cost of a clean conscience.
My advice? Just finish it up - you'll feel better, the client will feel better, and you'll be a better developer and businessman for it. It's not like it's a years worth of work - and you have all your friends at Stackoverflow and Stackexchange to help. ;)