I can't seem to find an answer for this on the internet, so I'll try asking here. I've come across a measure that lasts for five beats when the time signature is 4/4 and should only last for four beats. I am in no way an expert on music theory and know close to nothing about it, but I did figure out that the whole rest is present because it is the first voice. However, this doesn't explain why the second voice lasts longer than it is supposed to. Hopefully someone knows why this is?
That isn't a measure of five beats but four.
I think you're right about the whole rest - that's one voice, the quarters are another. Let's set it aside and focus on the second voice.
I'm guessing you're mistaking the dots under the notes for the dots that mean "plus half of length", but those would be written after the note (to the right of its head), never under. This is something else - these are staccato marks (and the line under the first note is a tenuto mark). Staccato means to articulate the note as shorter than written, giving the tune a sort of "chopped" sound. Tenuto means, don't do that with this note, hold it in full.
Wikipedia has a helpful List of musical symbols in which you can look up various unfamiliar notation.