Arjuna got the Brahmasira weapon from his Preceptor, Dronacharya.The Brahmasira weapon, along with the methods of hurling and recalling it, was given by Dronacharya to Arjuna, after he had saved Dronacharya’s life from a strong alligator, which had seized Dronacharya's leg, when he was bathing in the sacred river Ganga.
The description is as under:-
Some time after, O bull of Bharata's race, Drona, accompanied by all of his pupils, went to the bank of the Ganga to bathe in that sacred stream. And when Drona had plunged into the stream, a strong alligator, sent as it were, by Death himself seized him by the thigh. And though himself quite capable, Drona in a seeming hurry asked his pupil to rescue him. And he said, 'O, kill this monster and rescue me.' Contemporaneously with this speech, Vibhatsu (Arjuna) struck the monster within the water with five sharp arrows irresistible in their course, while the other pupils stood confounded, each at his place.
The son of Bharadwaja then addressed the illustrious and mighty car-warrior Arjuna and said, 'Accept, O thou of mighty arms, this very superior and irresistible weapon called Brahmasira with the methods of hurling and recalling it.
Thou must not, however, ever use it against any human foe, for if hurled at any foe endued with inferior energy, it might burn the whole universe.
It is said, O child, that this weapon hath not a peer in the three worlds. Keep it, therefore, with great care, and listen to what I say. If ever, O hero, any foe, not human, contendeth against thee thou mayst then employ it against him for compassing his death in battle.' Pledging himself to do what he was bid, Vibhatsu then, with joined hands, received that great weapon
Reference-Mahabharata Book 1:Adi Parva, Sambhava Parva.
Reference link:- http://www.sacred-texts.com/hin/m01/m01136.htm