They say everything in life is timing, and that certainly applies here. First, the facts: your GMAT score is valid for five years. That gives you a nice, long run of admissibility.
One of the reasons five years is helpful is because Business Schools prefer to admit students who are two to four years out of college. They want individuals with work experience. The five year validity period for the GMAT gives you options for timing the test around your needs and life.
One option is to take the exam while you're still in college, or shortly after college graduation when you're still in student mode. Being out of school for a few years can make it harder to go back to test-taking. You might want to get it out of the way. (Of course, there is always the chance you may change your mind, and decide not to go to Business School).
Or the opposite may be true. You may need a total break from school, and prefer to take the test closer to when your application is due. Some students say this is when they have intense focus and can knock out a top score. But remember, at this time it's likely you'll be working a full-time job and may have serious commitments. Studying for this kind of test on top of work, can be difficult.
Whatever you decide, the golden rule is this: take the GMAT when you feel poised to get your best score. Timing matters. But your score matters more. A higher score may pave the way into your first choice school, although work experience is heavily weighted too. An awesome tutor, guide book, or reputable test prep class can help you do your very best.
If you take the GMAT more than once, you should know that ALL of your scores will be reported. Use practice exams to approximate what score you'll get rather than the real test. Also, it makes sense to check in with your prospective schools to make sure they're okay with a potentially five year old score. They may require a shorter window. Or they may state a preference. If they don't, they'll have no bias toward WHEN you took the exam. Their focus will be on your score, period.