When you see your friend after long time, please say "It's been a while!" in Japanese with a smile. But if you say that only in a few days after you last saw him, your friend will be 'rough' and 'correct' you that it's not been a while. This is actually a typical Japanese joke.
Elementary Level
It's been a while in Japanese is
ひさしぶり
Hisashiburi.
and in polite way you can say
ひさしぶりですね
Hisashiburi desne.
or in more plite way
ごぶさたです
Gobusata des.Advance Level
Follow by It's been a while, you can add some other phrases.
These are a few examples.
ずっと、なにしてたんですかー?
Zutto nani shitetan desukaa?
What have you been doing all this time.
髪のびた?*casual way
Kami nobita?
Has your hair grown?
刑務所にでも、いたんですか?
Keimusho nidemo itan deska?
Were you in the prison or somewhere?