What said islam about having friends with different religions or even atheists ones? I know that we have to respect the opinion of each one but can we be closer freind?
When referring to interacting with non-Muslims, the Quran says:
As for those who have not fought against you for your religion, nor expelled you from your homes, God does not prohibit you from dealing with them kindly and equitably. God loves the equitable. (The Quran, verse 60:8)
The Quran does not have anything more specific than that to tell us and does not define limits on friendship, which can be taken to mean that it leaves it to our own judgment. One non-Muslim can have a beneficial influence on you while another may have a harmful influence. So they should be judged just like we judge Muslim friends. If we find that our character is harmed by association with them, then it does not make a difference whether they are Muslim or non-Muslim.
However, it is not good to befriend an atheist who has a snarky attitude toward religion, or a non-Muslim who dislikes and looks down on Muslims. But this should be obvious.