If you are learning Hsing I from a qualified instructor, the length of time for Hsing I to be effective in the streets is dependent on how hard you practice. Generally though, a 1 year Hsing I student with three hours of correct practice a day should be able to handle themself pretty well in most street situations as well as against other martial artist. If you have practiced for 5 years and you cannot handle 5 year karate student or a street fighter, then I would say either your teacher is not teaching you correctly, or you are not working out hard enough. (Or you have an unfortunate physical handicap that hinders you, in which case, keep practicing, you will be glad you did.)
There is a saying I learned when I first started Hsing I. "yi beng, kan xue." It means, "one beng chuan, and you will see blood".
I hope this answers your question.
Good luck practicing.