By the end of the year, I would have attended this school for five years.
Of course, the "most" correct way of writing this would be:
By the end of the year, I will have attended this school for five years.
...but I was just wondering.
The two sentences mean slightly different things. In the first case, it is understood that you don't intend to continue attending school.
If I did not have to leave, I would have attended school for 5 years at the end of the year.
In the second case, you express the belief or the confidence that you will still be in school at the end of the year.
Since I'm staying, I will have attended school for 5 years at the end of the year.
The first sentence is an acceptable English sentence, but as the previous answerer states the two sentences differ in meaning; they are used in different circumstances. In addition to being acceptable if your intent is to not finish school, the first sentence is acceptable if you in fact have already quit the particular school that's being talked about:
In fact, the first sentence is acceptable even if you had never attended that school in the first place (though it seems necessary to have considered the option of attending):
Hope this helps.