If your boyfriend's court appearance will be his first one, it will probably just be a magistrates' court hearing, which will refer the case to the Crown court. There will then be another delay before the 'plea and directions' hearing at the Crown Court. (There might well be a preliminary hearing first). Then it's likely that the court will be adjourned for reports to be compiled. Your boyfriend probably won't actually be sentenced for several months yet. He's likely to remain on bail until at least the 'plea and directions' hearing. However, once he's pleaded guilty he might be sent to prison 'on judge's remand' while the reports are compiled. (That's not certain. He might still be bailed until the sentencing hearing).
Section 18 assaults are regarded as very serious offences. They're only one step lower than 'attempted murder' and the maximum penalty is life imprisonment. So very few offenders avoid prison. (Some do, but I wouldn't want to get your hopes up too much). Your boyfriend's barrister might well be able to persuade the court to impose a lower sentence than the 3 years referred to above. I'd guess at a sentence of between 12 and 18 months imprisonment, of which only half is actually served in prison.
Chris