There are many factors to consider; first and foremost, if you need income, and you need that income to be high, getting a job might be a good idea. PhD programs pay, but not nearly as much as industry, and Masters programs will cost you money. So graduate school might only make sense if you’re willing to temporarily defer the high salaries that can come with working in industry.
But there are other things to consider. If you’re young and without dependents, how do you want to spend your twenties? Joining a team and shipping products? Or learning and inventing? While industry can have an impact on the software and technology available in the world, it rarely gives you time or freedom to explore unanswered questions — in industry, there is typically only time for the more incremental, urgent problems of the organization you’re working for. The whole point of research is to make space away from those constraints to answer questions that have importance 10, 20, 100 years from now in society, rather than only being focused on the quarter’s profit. Masters programs can be a middle ground where you learn about the latest discoveries for 1-2 years and take them back into the world.
That said, you can always come back to do a Masters or PhD. Getting practical work experience, developing your interests, and experiencing non-academic environments can be great ways of figuring out when, whether, and why you might want to pursue an advanced degree.