Under section 24 (B1) of the Immigration Act 1971, a person who a) requires leave to enter the United Kingdom and, b) knowingly enters the UK without such leave, commits an offence which is triable both ways.
A person who commits this offence, on summary conviction in England and Wales, to imprisonment for a term not exceeding 12 months or a fine, or both. On summary conviction in Scotland, that person is liable to imprisonment for a term not exceeding 12 months, or a fine not exceeding the statutory maximum, or both. In Northern Ireland, the maximum sentence on summary conviction is 6 months imprisonment, or a fine not exceeding the statutory maximum, or both.
For conviction on indictment, that person is liable to imprisonment for a term not exceeding 4 years or a fine, or both.
However, most cases are normally managed using administrative powers to consider whether it is right to remove a person from the UK, except where there are aggravating or egregious factors that mean it is in the public interest that the individual should be prosecuted.
https://www.gov.uk/government/publications/powers-and-operational-procedure/irregular-or-unlawful-entry-and-arrival-accessible
Build detention camps not hotels!