All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The rulings which you mentioned in your question, like conditioning 5 suckling times within the age of two years old, and other rulings; some of it are taken from the Sunnah and some from the Quran. However, conditioning 5 suckling times [to make one forbidden for marriage] is not written in the Quran, but this is mentioned in the Sunnah. 'Aa'ishah said that conditioning 5 suckling times is something which was recited in the Quran, then its recitation was abrogated but its ruling remained.
It is known that the Sunnah is a source for legislation exactly in the same manner the Quran is a source for legislation. Indeed, there are many acts of worship and other religious rulings which are not detailed in the Quran, and they were only detailed in the Sunnah, like the manner of performing the prayer, the amount of Zakat, many rulings concerning Hajj and so forth.
As regards conditioning the period and age of two years for suckling, then the majority of the scholars provided evidence from the Saying of Allaah (which means): {Mothers may nurse [i.e. breastfeed] their children two complete years for whoever wishes to complete the nursing [period].}[Quran 2:233]. Because the suckling period finishes within the age of two years, and thus no suckling should be taken into account after the period of two years. The amount of suckling depends on what people are accustomed to, whatever is considered as a suckling in people's customs, is religiously suckling, because the number of times of suckling is not determined in Islamic law, this means that the Islamic legislation referred the people to the customs. Therefore, if a child suckles and stops by his own will, then this is considered as one time suckling, and if he suckles again, it is considered as a second time suckling and soon, until he finishes 5 sucklings.