Do the commas (or lack of) change the meaning between these two sentences:
In the beginning, when the house was sold, it didn’t bother me too much.
In the beginning when the house was sold, it didn’t bother me too much.
It does. In you first example , when the house was sold, works as an apposition of in the beginning:
In the beginning, that is, when the house was sold, it didn’t bother me too much.
Here we understand that "the beginning" is when the house was sold.
In your second example, in the beginning can be understood as at first, initially:
At first, the fact that the house was sold didn’t bother me too much
If "when" were a relative adverb the sentence would be meaningless;
At the time when the house collapsed there was no one within. (relative adverb)
At the end of the summer, when swallows had not yet left on their migration, the weather suddenly became very cold. (conjunction)
Therefore, "In the beginning" and "when the house was sold" are both time adjuncts.
Normally, a comma should separate any sequence of adverbials; so, "In the beginning" and "when the house was sold" should be separated by a comma (which indicates asyndetic coordination). This means that there is no difference in the meaning.
(Note that in the example supra, the relative adverb posibility makes sense, and it is recognized then because no comma is used: "They live in the the depths of the ocean where light does not penetrate.". )
This story takes place at the end of the 15th century, when Columbus dicovered the New World.
(Relativistic Astrophysics, 2: The Structure and Evolution of ... -Borisovich Zelʹdovich, I. D. Novikov · 1971) However, even if the density of neutrinos and photons is negligibly small and the temperature equal to zero, consideration of pressure would still be necessary at the beginning, when the density of baryons is very high.
Most of the time writers do use a comma in this context.
at the beginning when On this page the comma is used about 50 times and is omitted about 20. There is even a case of use and omission within the same sentence, where it is obvious that there is no difference in meaning whatsoever.
(The Santa's Great Treasure Chest: 450+ Christmas Novels, ... ) But all through this night of Christmas Eve he lay awake; and no dream had ever been as half as sweet as the thought. It would have been a hideous waste of time to sleep, when he could lie there and live over again each moment of this evening, beginning at the beginning, when She had come into the room, and going on to the end when he had brought her and Rosemary to the door of the Hotel Beau Soleil, to say "goodbye until tomorrow".