How important is the time it takes to graduate? In some countries (e.g. Greece) there is no penalty if you fail a course. You can simply try again next time. Also, there is no limit to the amount of time it takes to get a degree.

I am a good student who works hard and tries his best to get good grades.

Unfortunately, on my 1st semester some very bad things happened and I passed no courses for 3 semesters. I will explain this in my essay.

Is it reasonable for me to expect to be accepted by top US/UK universities for a Masters in Computer Science given that I get high grades, but I take 5-6 years instead of 4 to get my degree?
to answer your first question and then comment on a statement:

Personally I graduated from both High School, and my first B.S early. There's not advantage or disadvantage when another school (or even the school you attend) looks at your record to decide if you can enter the program. There isn't a disadvantage to graduating late either. The rate of students who graduate (In the U.S) has dropped the past years for a few reasons:

1). Financial issues.

2). Work &amp; school at the same time limits the amount of courses you can take at one time. 

3). Single-course to graduate students (there's no formal name for this so I'll explain). Some students take 1-2 courses a semester and may even skip a semester or two. They do this to keep educating themselves and eventually earn a degree without having to stress over taking 4-6 courses at once. 

You mentioned failing courses because of personal reasons. Normally when this happen's grades are seen to drop and the student either drops out or get's back in the school motion and grades rise. You mentioned failing courses for 3 semesters which could look bad (granted I don't know what caused the issue in the first place). Be ready to talk about it in person and in your essay because it's unusually for someone who is failing semesters to continue to attend.