おや、もうこんな時間。
Oya, mō konna jikan.
Oh, look at the time!
When you visit the home of a friend, it is generally left up to you as the guest to bring the visit to an end. One time-honored pretext for doing so is to remark on the lateness of the hour, for which purpose this expression works wonderfully. When you feel the time has come to be leaving, wait until the conversation begins to flag or some other convenient opening appears, then consult your watch or a clock and utter the magic words as you rise to go. According to the rules of politeness, this is the signal for your host to insist that it’s too soon to depart, saying something like:
まだよろしいじゃありませんか。
Mada yoroshii ja arimasen ka.
You don’t have to leave already, do you?
You shouldn’t take this literally― your host is merely performing a role as required by courtesy. Besides, it’s considered very bad manners to overstay your welcome, so feel free to firmly resist the (ostensible) invitation to linger:
いえいえ、すっかり長居してしまいました。
le ie, sukkari naga-i shite shimaimashita.
No, I’ve already imposed on your hospitality far too long.
Presuming there are no further politely forceful attempts to detain you (if there are—be strong!), you can prepare to take your leave, but first offer some appreciative comment, like:
今日はとても楽しかったです。
Kyō wa totemo tanoshikatta desu.
I had a wonderful time today.
Should you find yourself tiring of the old checking-your-watch routine, another other useful expression for signaling your imminent departure is:
そろそろおいとまを ……
Sorosoro oitoma o …
Well, I’d best be getting along.
There are more elaborately polite expressions that make use of the term itoma (“leave-taking,” here preceded by the honorific prefix o), some of which have been immortalized in rakugo routines and the like; you could really make an impression on your hosts if you were to say, for example:
あまり長居をいたしましては帰ってご迷惑でございますから、これでおいとまを。
Amari naga-i o itashimashite wa kaette gomewaku de gozaimasu kara, kore de oitoma o.
I would be imposing on you if I were to dawdle any longer, so I’d better be going.
If you have been treated to a meal by your host and then decide that you have stayed just about as long as courtesy requires, you can make your departure in style with this somewhat antiquated bit of verbosity:
いただき立ちで申し訳ございませんが、そろそろおいとまを。
Itadaki-dachi de mōshiwake gozaimasen ga, sorosoro oitoma o.
I apologize for having to eat and run, but I’m afraid I have to be going.
As you say this, keep in mind that rude though it is to eat and run, it’s still worse to abuse your hosts’ hospitality by overstaying your welcome.
– Source: A handbook of common Japanese phrases –