You would also need to know how much shaft you have sticking out through the bearing to start with would you not?
Yes, spot on! Which is probably why I'm having trouble figuring it out!

I'm looking at slicing something like an 80mm length of 70 x 70 x 4 and mounting the motor on one of the "x4" side walls, with the bearing on the opposite side. So, the ID (62mm) of the box section is the space available to fit the coupling and anything else etc.

I'm trying to find out if 70mm square is going to give me enough room inside, or if I need to go to 80mm, or more.. But I want to use the smallest size that is practical.