The issue here is the English school system, which can be confusing to non-English people. (Apparently. As an Englishman, I don't understand what's hard to grasp about it but I've heard non-English people have trouble.) (And I do mean non-English, not just people for whom English is not their first language.)
But it works like this - we have a School Year in the same way that there's a Calender Year. The School Year runs from September 1st to August 31st. At Hogwarts, you are 11 years old when you become a First Year. (Unless your birthday is on September 1st, in which cause you would be the oldest student in your year group.) By the end of their First Year they would be 12. What you have to keep in mind is that strictly speaking, they continue to be First Years until August 31st.
What makes this confusing for non-English HP readers is the fact that JKR wrote the books from the start of the summer before a school year. That means that although Harry turns 12 in Chamber of Secrets, at the time of his birthday he is still officially a First Year. Legally, he doesn't become a Second Year until September 1st.
So back to the issue in the question, with the above system students turn 17 during their 6th year, which means 6th and 7th years can enter the tournament. I think people probably get confused by this because Fred and George, who are 6th years during GoF, cannot enter. This is because their birthday is in April, so at the time of entry they're not yet 17.
(On a side note, this strikes me as a stupid idea; students who turn 17 during the course of the tournament should have been permitted to enter. With the rules as they are, 6th years whose birthday are in September or October can enter, but not those with birthdays at any other time of the year.)
You're right that everyone starts their Seventh Year at the age of 17, but they will all be 18 by the time they leave. (Except those whose birthday falls in July and August; they're 17 when they graduate but will be 18 by the end of the School Year on August 31st.)
This got a bit long-winded but I hope it answers your question thoroughly. :)