There are quite a few posts on immigrationboards.com where they have not been allowed back into the UK on the tier 4 visa as their course had finished. You might want to have a read of some of their posts on that board? Some have said that they did manage to be let back into the UK.
Many students on that site have asked the same as you and the general answer seems to be that if you want to play safe and be in the UK until the end of your tier 4 visa, then don't leave the UK after your course has finished.