Heat the oven to 375°F and arrange a rack in the middle. Coat a 13-by-9-inch baking dish with butter; set aside.
Meanwhile, cut the bread into 3/4-inch cubes and place in a large, heatproof bowl; set aside.
Melt the measured butter in a large frying pan over medium-high heat until foaming. Add the onions and cook, stirring occasionally, until they're just starting to brown, about 5 minutes. Add the apples, celery, thyme, and sage and cook, stirring occasionally, until the apples are tender and can be easily pierced with a knife, about 6 minutes.
Add 1 cup of the stock or broth and bring the mixture to a simmer.
Turn off the heat and add the vegetable-apple mixture to the reserved bread cubes. Season with two or three large pinches of salt and two large pinches of pepper, then stir to evenly combine. If the mixture seems too dry, add more stock or broth 1/4 cup at a time (but make sure it doesn't get mushy).
Transfer the mixture to the prepared baking dish and bake, uncovered, until the top of the stuffing just starts to get brown and crusty, about 30 to 40 minutes.