This debate has been going on since the very first NHL game in 1917. You could interview the Top 50 coaches of all time and they'd give you different answers.
The real issue is nowadays sticks break all the time, that was not always the case. I myself played in late 80's and early 90's and it was super rare to break a stick. There was a time in the NHL where you'd never see a stick break, that sure is not the case now.
FWIW I always say if you are at even strength and you break your stick in your own end and the other team has the puck, get off the ice if you have the "short change" (bench closest to defensive zone), and stay on the ice if you have the "long change" (bench farthest away).
If you break your stick and you are already short-handed and the other team has the puck, always stay on the ice.
But as I said, there is no right or wrong answer.
It is kind of like in NBA basketball if you are up three points with 5 seconds left in the game, should you foul or not foul?