I said 'Five months' worth of the pill, please,' and was told 'Understood.'

Literal

Five-months [worth-分] [of-の] pill give [quotative-と] say, understood [quotative-と] was-told.

Quotative と appears twice in chain form: first marking the speaker's own request ('I said...'), then the response ('was told...'). ~分 attached to a counter means 'worth of / equivalent to' — 5ヶ月分 = 'five months' worth.' ピル is the katakana loanword 'the pill,' used by convention for oral contraceptives — one of several English medical terms borrowed to soften sensitive topics. 言われた is the passive of 言う, making the speaker the experiencer of being told something.