If he's in boxes, you can stay on the same day forever. If you don't go past the 6 AM mark either way, it should count as the same day, so he won't move out and you can hold him for longer.
For example, if it's 5 PM in your game, you can go back and set the time to 2 PM. If you're about to go to bed, just set your 3DS clock back (if it matches the in-game clock, set it to 7 AM or something. If not, do the maths so that the in-game clock is around that hour). This should let you stay in the same day until tomorrow.
I've never tried this myself, but I've heard of people keeping them in boxes this way. The 3DS clock thing is something that just crossed my mind, I think it should work if the method itself works.
If you've been time travelling forward and want to come back to the present, you won't be able to do that without voiding Stitches (if he's in boxes) since going back any amount of time is a day forward. If he's not in boxes yet, you can time travel back as long as you keep in mind that he'll move a day earlier. If he had 3 days left in your town, he'll have 2 days left when you go back because it's like going forward a day.