Patent / IP law is a very specialised area of law; many entrants will have some experience in similar (non-law) field before working in patent law.
The above poster offers some tips but is a bit mistaken in relation to length of courses.
There are two ways to get into law generally (i.e. non-IP based):
1. Do a law degree, and then study the Legal Practice Course (if you want to be a solicitor) or the Bar Vocational Course (if you want to be a barrister; this course is to be renamed the BPTC(Bar Professional Training Course) next academic year).
2. Study a non-law degree, and then take the conversion course (Common Professional exam / Postgraduate Diploma in Law / Graduate Diploma in Law); then the LPC or BVC as above.
Both of these routes end with a different course depending on what type of lawyer you want to be - you need to consider this, but not necessarily before you go to university. There is some good guidance on this site about the differences between solicitor and barrister so take a look at that.
If you chose to do a non-law degree (employers today seem to have little preference for either route), you should speak to your careers service about good degrees to do. It’s not essential to do something related to IP, but it may help.
IP, as with other areas of law, overlaps with other types of law, so it may be useful to have (e.g.) knowledge of business / corporate work as many IP clients will be businesses.
Before you go to uni, it would be good to try to get some legal experience - IP is a niche area so you may struggle to get any IP experience unless you have contacts in that area. Any legal experience would give you a better idea about whether you want to be a solicitor or a barrister, and working in law generally.
Also try to research IP law thoroughly so that you know clearly where you are going.