Why does Arthur only come out of his house at the end of the book?
The assumption of this question is not completely correct. Arthur does come before the end of the book on several occasions. From my count, he came out at least three times.
First, we see him come out to put in all the gifts in the tree knothole. Boo wanted to give gifts to Jem and Scout. This was his language of love, the way he was communicating his friendship with the children. He did this several times, even if the text does not make it explicit.
Second, when Miss Maudie's house burned down, he came out as well. Moreover, he was very thoughtful. He put a blanket around Scout. When Scout found out, she was shocked.
At the end of the book, he does come out in dramatic fashion, almost in deus ex machina fashion. He comes out here, presumably because he has been watching over Scout and Jem. So, when he saw that they were in grave danger, he did what all mockingbirds do - protect and serve.