Both work if the sets are hard; what matters more is your weekly total per muscle sitting around 10 to 20 sets.
The quick answer
Three hard sets taken within 1 to 3 reps of failure grow muscle just fine, and a fourth adds a little more if you can recover from it. The real number to watch is weekly volume per muscle, roughly 10 to 20 hard sets, not sets per exercise. If you only hit a muscle once a week, do 4; if you hit it twice, 3 per session is plenty.
How to think about it
Count the week, not the exercise
One exercise for 3 versus 4 sets barely moves the needle. Add up every set that hits a muscle across the whole week and aim for 10 to 20 hard sets. Chest, for example, gets volume from bench, incline, dips and flyes combined.
Effort decides it
Three sets left 2 reps short of failure beat 4 sloppy sets stopped early. Keep each set within 0 to 3 reps in reserve, and the difference between 3 and 4 shrinks. If your last set drops more than 2 or 3 reps from the first, you have enough.
Add sets only when progress stalls
Start at 3, run it for a few weeks, and add a fourth set only if the lift stops going up. More volume costs recovery, so buy it with progress. SUUPR tracks your weekly set count per muscle so you can see when you are under 10 or creeping past 20.
Do this
Tally weekly setsAdd up every working set per muscle across all sessions this week and check you land between 10 and 20.
Push each set close to failureStop with 1 to 3 reps left, not when it starts to burn.
Default to 3, earn the 4thRun 3 sets until the weight stalls, then add a set instead of jumping straight to 4.