Formal:
* Nous nous connaissons depuis très longtemps. (We have known each other for a very long time.) This is the most direct and literal translation.
* Nous avons une longue histoire ensemble. (We have a long history together.) This emphasizes the shared past.
* Notre amitié remonte à bien des années. (Our friendship goes back many years.) This highlights the duration of the friendship.
Informal:
* On se connaît depuis des lustres. (We've known each other for ages.) This is a very colloquial expression.
* On est potes depuis toujours. (We've been friends forever.) This emphasizes a close friendship.
* On a beaucoup de chemin parcouru ensemble. (We've come a long way together.) This emphasizes the journey you've shared.
The best choice will depend on the specific context and your relationship with the person you are speaking to.