While you may be close, you are not a family unit and should approach separately.
If airport staff directs you to separate lines, just go with it.
As to whether they know you're travelling together, maybe, maybe not, but it doesn't matter.
There's nothing at all unusual about friends travelling together.
Important point, if you're asked if you are travelling with someone, don't lie .
Just say yes
and if asked, point out your friend.
travel.stackexchange.com/users/46803/Johns-305
When I travel together with someone (whether my mum or a friend), it's always been natural for us to approach together, including in the UK, France (including Guadeloupe and Martinique), Germany, Switzerland, Sweden, Bosnia, Macedonia, Turkey, North Cyprus and Georgia (in fact I will often hold both of our documents).
So far no one has ever given us grief for that.
However, anecdotal evidence suggests officers may not allow it if you aren't family, but unless you're in an ultra-sensitive country like the US, where you risk getting sent back over the slightest error, the worst thing that can happen is they ask one person to back off while the other one is processed.
If you absolutely don't want that to happen, stay together in the queue, try talking to each other so the officers realise you're together, but let one approach the officer first, and if asked about the other person, point to the other person.
the Immigration and Customs officers, would they be able to know if we booked our tickets together or is that information not available to them?
In some advanced countries like the US, they may know once they scan your documents, because of advance passenger information.
In general, though, no.
travel.stackexchange.com/users/39782/Crazydre
It depends much more on the place you are travelling to than on your relationship status.
On my last trip to Russia, for example, that customs officers told us clearly that the signs "approach individually" also apply to married couples.
In general, approaching seperately is always the safe option.
Anyway you will have separate visas and passports.
For Thailand approaching together might work, for Japan
I dimly remember the same as for Russia above was true, but it's been 10+ years since I travelled there.
travel.stackexchange.com/users/13671/Tom
We always approach separately because it is faster.
However, after landing in Japan (Tokyo-Narita), my girlfriend came to the officer and he asked if we had traveled together, then he prompted me to go, so we went through immigration at the same time.
I can't see any problem with going separately: both of us had a form with address of hotel we planned to stay (actually, it was Airbnb apartment), passport and a ticket.
Japan immigration is very professional and helpful, just asking about the purpose of a visit and sometimes inspecting luggage.
travel.stackexchange.com/users/43688/DDT
Since you are not going to the US, I wouldn't sweat it, though I would expect the Japanese to be a bit alert, especially if you are younger, since you are coming from a country that is known as a source for drugs.
Sometimes they want people "traveling together" to approach together, sometimes only family, sometimes only individuals.
If this is a typical vacation trip, then all should go very smoothly and the Thai and Japanese officials are always very polite.
If your traveling companion is behind you there will be no problem.
There may be cases where people pretend not to know each other and go through separately, so I would avoid the appearance of that.
As to US, here is a typical experience from this site: I've entered the US from Canada (@ YVR pre-clearance) a few times with friends, and I've had the officer get angry with me for both situations. 1)
Walk up alone, friend stands behind red line: (Officer looks up at friend standing behind red line): "
Are you two traveling together?"
"Yes, sir."
"Then why ISN'T HE UP HERE WITH YOU!?!?!"
(Friend hustles forward.)
2)
Another time, walk up together, friend stands next to me.
"Are you two a family (sneer)?"
"No, Sir."
"The GET BACK BEHIND THE RED LINE!"
travel.stackexchange.com/users/12046/Spehro Pefhany
I will be traveling to Thailand and Japan with my friend/roommate. We booked our tickets together. My question is, when going through Immigration and Customs at our destination, do we go through together as a 'single family' or is it okay to go through separately? We live in the same apartment, but we are not related.  Another question (I'm just curious), the Immigration and Customs officers, would they be able to know if we booked our tickets together or is that information not available to them?
Traveling with friend/roommate, do we go through Immigration separately or together?
travel.stackexchange.com
<customs-and-immigration>
travel.stackexchange.com/questions/113671
travel.stackexchange.com/users/76847/Nicee Chapin
It would be safer to approach separately as you are not a family unit, but the airport staff might direct you to approach together, or to separate if you approached together. The travel documents may indicate that you are travelling together, so the official will know and can decide. It is adviced that you approach the customs officer seperately unless you are family members. If you are told to separate just go with it and there should be no problems. As for whether or not they know if you booked your flight together, there may be a chance of that in advanced countries once they scan your documents i.e like in the US.
If you are not family the is anecdotal evidenc to suggest that you approach the customs officer seperately. When travelling with family memebers or what appears to be a family member i.e girlfriend/boyfriend then there is no problem approaching the officer together ad in some cases you are even asked to approach together. In some adanced countries like the US they MAY know you booked your flight together once they scan your documents.