Why an electron has a negative charge and that of a proton has positive?
It is difficult to answer that why electron has negative charge just like it is difficult to answer other naturally existing things.
It was J.J. Thomson in 1897 who discovered sub atomic particles in an atom and named it as electron. J.J Thomson performed cathode rays experiment to find the charge of an electron. Rays were emitted at the cathode in a discharge tube, the negatively charged particles which were repelled are attracted to the anode so the rays must be negatively charged.
After the discovery of the electron, Rutherford thought that there must be positive charge particles within the atom to balance the negative electrons. Rutherford's discovery positive charged particles and named it as proton by performing gold foil experiment.
For more details about the experiment follow the link provided.
check Approved by eNotes Editorial