The minimum degree required to be a utility patent examiner is a bachelor's degree. There are dozens of STEM-related bachelor's degree types that qualify, even if they are not the exact discipline listed in the title of the job vacancy.
In order to be a patent lawyer who works to secure patents for inventors, students will be well served by an undergraduate science or engineering degree. That is not required, however, for other types of IP law (including IP litigation or entertainment, sports, copyright, or trademark law).
For most types of intellectual property law, the undergraduate degree does not have to have a special focus. The exception to that is patent law. If you want to become a patent lawyer, you should major in science, engineering, or physics. Other technology-related courses will also be helpful.
Both Patent Agents and Attorneys must either have a degree (B.S., B.A., Masters or PhD) in science or engineering, or have taken a certain amount of science and/or engineering classes to qualify to sit for an exam called the Patent Bar.