There's no hard and fast rule for how often you should take breaks. It's a good idea to schedule buffer times between tasks so that you can switch gears and maybe snag a quick cup of coffee.
You'll also need to follow the 20/20/20 rule to protect your vision. When looking at screens, look away from the screen every 20 minutes, focusing on something around 20 feet away for 20 seconds. You'll also want to take a 20-minute screen break every two hours.
However, aside from these guidelines, there's no real rule as to how often you need breaks. Take breaks as often as you need them.