Keep in mind the fact that proton is a bound state of 3 valence quarks. It's not an elementary particle.
There are two main families of elementary fermions. Leptons and quarks. Within each family, there are 3 generations. Within each generation there are two flavors.
Electron is the member of the lightest generation of leptons. The two flavors within a generation have charges that are different by 1. Electron has charge -1. The other flavor in the same generation is the neutrino. It has charge of 0 and is extremely light.
The second generation of leptons contains muons and muon neutrinos. Muons, again, have charge of -1 and are 200 times heavier than electrons. Muon neutrinos are neutral and are also extremely light.
Finally, there are tau and tau neutrinos. A tau has the same charge as electron and is otherwise almost identical, except it is significantly heavier than a proton. Tau neturino, again, is almost massless.
Protons and neutrons consist out of lightest generation of quarks. Up quarks and down quarks. Up quarks have charge of +2/3 and down quarks -1/3. Again, difference is exactly 1, even though the actual numbers are fractions. Defining mass of the quark is difficult, because quarks never exist alone, but in any meaningful definition an up quark is slightly heavier than a down quark.
Because flavors of the quarks and leptons can change, any particle system collapses to the lightest possible constituents. However, charge must be preserved. This is why we are dealing with a world of protons, neutrons, electrons, neutrinos. Neutrinos mostly avoid detection, however.Ok, now back to the question of charge and mass. There is definite contribution to the mass of the particle from its charge, but as you can plainly see, it's not the only contribution. Leptons with the same charge can differ in mass despite being far more similar than electron to proton. With composite particles, it's even more simple. Most of the proton's mass is in kinetic energy of the quarks and gluons that make it up.
A far more interesting question is why charge of both particles ends up being 1 despite them being so different. That goes back to the fact that within a generation, the charge can only change by 1. The answer to that is not completely understood yet. Super-symmetry attempted to tackle that, but unfortunately, it results in many predictions that are still not verified. All in all, it's an open question.
Edit: As far as proton and neutron. Proton is up, up, down quarks. Neutron is up, down, down. Because up and down quarks have similar masses, proton and neutron do too. There is also a configuration difference, as you point out, which results in proton being lighter than neutron, rather than the other way around, as you'd expect. Which is fortunate, because that's exactly the reason why hydrogen is dominant form of matter in the universe, and not neutron matter.