I don't remember exactly which episodes they were, but there were several points where Sasuke clearly indicates that he thinks Naruto is his best friend. Why is that? They never really come off as close friends - more as co-workers with a competitive spirit (and eventually straight up enemies). Sasuke always seems to be focused on Itachi rather than Naruto and constantly expresses jealousy for Naruto. I can kind of understand why Naruto would be so fixated on Sasuke (they have similar backgrounds and he is the first boy that Naruto can get to know and have constant interactions with) but Sasuke seems to show this fixation later when Naruto suddenly gets good. At no point does Sasuke ever treat him like a best friend or close person.
Naruto is Sasuke's best friend because he is actually his only real friend. I'm going to cover the initial character development and the final leading upto shippuden and try to explain the crux of the relationship between Sasuke and Naruto. This is going to be a long answer, hence apologies in advance if I go off rails a bit. :)
From his childhood he was as much of a loner as Naruto was. Both had no real kinship to anyone. Naruto's fixation towards Sasuke was a similar hindrance as that of the girls' crush on him. He cares only for strong and it can be seen as his interest in only the strong Genin such as Lee, Neji and Gaara. This changed with Team 7. From their first real mission (Land of Waves Arc), he realized what the "teamwork" could do that Kakashi talked about. Nothing helps forge kinship in a way than facing an adversity together.
If we look at the Land of Waves we see Sasuke's Character development:
1. Disdain for Naruto
2. Realises Teamwork and Synergy: Defeating Zabuza 1st time
3. Training Together: Satisfaction
4. Saving Naruto's life by sacrificing his own (He doesn't know he has plot Armor)
In the first three images, we can see Sasuke has a very similar facial expression, but through the context we can see that his attitude has changed a lot! For the first time in his life he is experiencing the feeling of camaraderie.
The first part of Naruto is Sasuke's journey as much as that of Naruto. We see Sasuke form actual bonds with Team 7 before they deteriorate again. Sasuke had always chased "strength" to defeat and kill Itachi. When he saw Naruto's growth he tried to break his "bonds" by belittling him and trying to undermine his self respect. Naruto however never gave up and followed him even when he left with the Sound Four.
The battle at the valley of the end is actually a realization on Sasuke part.
- He finally accepts that Naruto is his friend (Best by being virtue of only because he accepted no one else, even Kakashi or Sakura).
- He makes a conscious decision of "breaking" the friendship for fulfilling his self proclaimed destiny of revenge.
- He leaves Naruto alive because he didn't want to follow Itachi by killing his "best friend".
From the flashback we know the significance of "friend" for Sasuke and his final decision
It is interesting to note he finally acknowledges Naruto, and faces his own feelings for him as a friend. This brings an end to the first part of Naruto leading upto Shippuden
Naruto and Sasuke have something closer to brotherhood not friendship.
The Naruto plot needed there to be an underline friendship between the two of them(to facilitate the underling Asura and Indra plot). I always felt that their brief time together could never have fostered such a great bond. But, I guess they could have each seen each as the other but for a different set of circumstances. They both have the same origin story; their paths just diverged.
It says in season 3 that Naruto is Sasuke's best friend. Naruto saw that Sasuke was alone at the time just like him. Instead of talking to Sasuke becoming his friend, he became a rival.
However, as the time passed through, they started becoming friends. Just like at the dock when they smiled back at each other. It's just that since they were getting along better through their time together in team 7, they had become friends. In this episode, he clearly states that Naruto is his best friend because of the time they spent together.
Showing that Naruto is his real friend, he didn't kill him. Instead, he left him behind. From what Itachi had said, "kill your best friend for the Mangekyou Sharingan power". He had to kill a friend, which in his reaction he had to choose Naruto. Instead, Sasuke walked away telling himself there had to be another way other than killing his best friend (Naruto).
So how they became best friends is through what they did in team 7.