Once its been deducted, I reckon you can only get it back immediately after the end of the tax year year (i.e. April 2007). This is because if you work again, say at Christmas, the IR have to have a way of tracking the total amount you have earned in the YTD. You get it back using the P45 your employer provided you with - the same form you would have to provide another employer if you restarted work in this year year.
You shouldn't have to wait until the end of the tax year if you tell your tax office you are returning to full time education and will not be earning again before next 5 April. Send in your p45 (keep a copy) to your tax office with a covering letter - they may ask you to fill in a P50 as stevie21 says, but in my experience a letter and the P45 usually suffices.
For future reference, if you are a full-time student and working in the summer holidays you can ask your employer to give you a student form - you sign this to say you will not be working again in the tax year, and they will not tax you unless you earn more than your annual allowance over the summer. You can't do this in the Christmas or Easter holidays though.
You won't get your National Insurance back though.