You can enter 1 minute before the exam if you want as long as the centre has enough papers. Will cost you double/triple depending on the exam board though.
Up to the minute, or after you've sat it. I resat an exam I wasnt entered for because they handed me a paper and I had a mental lapse, but it went well so they sorted it out afterwards.
As everyone has said, you can be entered for an exam literally at the last second. I have experience of this- being entered for the wrong module, neither I or my teacher realising until I opened the paper and then being entered for the correct paper right then. However it did cost my school a lot more.