There is an interesting story behind the how Lord Venkateshwara got that name. This is not because of the confusion of who the deity in Tirumala is.
Once upon a time, there was a controversy between various sects of our religion on who is the presiding deity of Tirumala. There were different theories that the deity in Tirumala is Shiva, Shakthi, Kartikeya, Srimannarayana. Many debates were held among those sectarians regarding this issue. But no one could prove their theory as correct.
But Bhagavad Ramanujacharya, founder of Visishtadvaita philosophy visited Tirumala and took part in the debate with other sectarians. He proved that the presiding deity is none other than Srimannarayana through debate and also an experiment called locked doors(see the comments thread). By that experiment, all were convinced that Venkateshwara is none other than Srimannarayana.
In His lifetime, Bhagavad Ramanujacharya visited Tirumala 3 times and organised the puja vidhanam to the Lord and made rules on how the Lord should be worshiped. He also appointed his disciples to carry on the tradition of worship to the lord.
How did Lord Venkateshwara get the name Balaji?
Bhagavad Ramanuja made the rules on how Venkateshwara should be worshiped and different sevas performed to the Lord like Abhishekam etc.,.
On a Friday(Ramanuja was the one who made the rule that abhishekam should be performed and it is followed till date) while Abhishekam(holy bath) was being performed to the lord with the Akasa Ganga waters,The white part of the tirunamam of Lord Venkateshwara got melted and only red part and white part under the eye brows of Venkateshwara was visible(Like the women of Sri Vaishnava tradition wear the namam). Looking at that scene, Sri Ramanujacharya got mesmerized by that beauty of the Lord and thought in his mind as follows:
Oh Lord! How beautiful you are, How beautiful your face is. I am mesmerized by your beauty. Once you took the incarnation of Mohini and mesmerized the worlds with your beauty. May be you are desiring to look like that again and make the people happy.
After this thought, the Lord conquered one of priests who were abhishekam said in a loudly voice as an approval. Yes Ramanuja! I am desiring to look like that. People who were sitting along with Ramanujacharya and watching the abhishekam were astonished by those words and didn't know the meaning of that. Later Sri Ramanujacharya explained. Thus Sri Ramanujacharya made a rule that the Lord should be decorated as Mohini avatar wearing a saree on Monday, tuesday, wednesday. On Thursday, Lord should be decorated with different flowers and a namam made of jewels should be put. On Friday, saturday and sunday, He should be decorated with different jewels.
This rule was well performed till the early 18th century. In the 18 century, the Mahanths reigned over the temple administration of Tirumala. By that time, the facilities on the Seven hills were improved. The number of devotees visiting Tirumala from northern states of India has increased. People who have seen Lord Venkateshwara in saree were pleased and called Him Balaji. Bala means a beautiful woman in Hindi. Ji means the respect people give to the deities for example : Ganeshji, Shivji etc., . Thus the name of Balaji got popularised in the north India even though He has other names. This is the real reason behind the history of the name Balaji. But this tradition of decorating the Lord with saree is forgotten by present TTD board who are the administrators of the temple.
This story was explained by HH Sri Sri Sri Tridandi Chinna Srimannarayana Ramanuja Jeeyar swami as a part of explaining the history and importance of Tirumala.