Does it matter how long ago you took a course for graduate school admissions This might be a strange question, but I was curious how much weight goes into when you took a course.  I took some math courses 4-5 years ago and did well in them.  Will the fact that I took courses from that long ago carry less weight when applying to grad school?
This depends a lot on what you've been doing in the interim. At one extreme, even if you had a solid coursework background, but have not been exercising it, or anything related, for the last decade, and admissions committee will worry that you're not up-to-speed.

At another extreme, if you did well in coursework and have been doing serious stuff subsequently, more-or-less related to your future goals, that's obviously a plus. That is, the "stale coursework" potential problem is not a problem for you since you've not only maintained, but improved, your chops meanwhile.

True, it's easier to flash a transcript to "prove" some knowledge or expertise, while professional knowledge or expertise is not universally set up to be "documentable".