What is the origin of vesperon? What language does it come from? I'm just looking for a good way to remember it.
"Vesper" is Latin for the evening. "Véspera" is still used in Portuguese to mean "eve", the day before. Not sure if that connection between eve (of the night) -evening might help.
"Víspera" is used in Spanish just the way you mentioned it is used in Portuguese
Do these words end with "-n" because this phrase is short for wishing somebody a good evening?
Yes, that's exactly right: because of the original, larger sentence they occupy the place of the direct object:
- Mi deziras al vi bonan vesperon. I wish you a good evening.
Why can you sometimes shorten "bonan" into "bon-" (attached to the noun); but apparently here Bonvesperon is not allowed. What is the rule and why does it seem arbitrary? I thought that the whole idea of Esperanto was that its rules were not arbitrary?
It's not shortening "bon-" by attaching it to another word. It's just a word starting with "bon-". All languages are arbitrary. Esperanto is just consistent in ways that make it easier to learn.