It's not uncommon for a defendant to turn up at court only to find out that, because of procedural difficulties (such as the CPS not having completed the paperwork) the case is immediately adjourned for a month or so. In that case, a defendant who had been on bail would almost certainly be given bail until the next court hearing.
Once a 'not guilty' plea has been entered, the Court must set a trial date. That will usually be several months ahead. Often there is no specific date given but, a week or so before the trial is likely to commence, the defendant will be advised (through his solicitor) that the case has been added to the 'warned list'. Then, at quite short notice (sometimes only the evening before the trial starts) he'll be told when he must appear in court again.
If a 'guilty' plea is entered, the Court can immediately pass sentence but, in most cases, would probably be unlikely to do so. It's more common for the judge to call for reports to be compiled by the Probation Service (and, where appropriate, by others, such as psychiatrists). If the judge is uncertain as to whether a custodial sentence will be passed (or confident that one won't be) he would normally release the defendant on bail until the sentencing date. But if he's reasonably confident that a custodial sentence will be passed (with the reports only influencing the length of that sentence) he will immediately send the defendant to prison, 'on judge's remand', to await sentencing.
Chris