Srimad Bhagavatam Canto 10, Chapter 45, Text 29

 SB 10.45.29

tatas ca labdha-samskarau
 dvijatvam prapya su-vratau
gargad yadu-kulacaryad
 gayatram vratam asthitau
 
Translation: 
 
After attaining twice-born status through initiation, the Lords, sincere in Their vows, took the further vow of celibacy from Garga Muni, the spiritual master of the Yadus.
 
Purport: 
 
Both Sridhara Svami and Visvanatha Cakravarti Thakura explain the term gayatram vratam as the vow of brahmacarya, or celibacy in student life. Krsna and Balarama were playing the part of perfect students on the path of self-realization. Of course, in the modern, degraded age, student life has become a wild, animalistic affair filled with illicit sex and drugs.
Srimad Bhagavatam Canto 10, Chapter 45, Text 28
Srimad Bhagavatam Canto 10, Chapter 45, Text 30-31