the answer for this isn't any number of years... i believe you should only tie the knot if you are so secure in your relationship that you can get through fights, genuinely trust each other, and have no doubt that they truly love each other... if you two have to get away from each other every time they fight, if a fight results in a break up, if one suspects the other of cheating, regardless if the other person did or not, or if there's any doubt they should be together, they aren't ready for marriage... building a secure relationship may take a year, or it may take 10 years...
are you ready to marry in my opinion?
are you both over 18?
are you shalling to compromise (compromise doesn't mean you get everything, and your partner gets nothing...)
are you without a doubt sure you want to spend the rest of our life with your partner?
are you able to pull through fights? (without taking a break for some time)
do you trust your partner?
are you able to accept the negative things about your partner? (they're not perfect...)
if you can answer yeah to every question, you have a secure relationship... if you say no to any of these questions, it doesn't necessarily mean you're bad... in fact, maybe you have a good reason for not trusting your partner, for example... nevertheless, your relationship isn't secure enough for marriage... when you get married, you aren't just marrying their positive qualities... you are also marrying the qualities they have that you hate... marriage is a rose... roses are awesome to have, but you shouldn't run into a bed of roses 'cause they have thorns... admire the roses, but watch out for the thorns...