As I understand it, the people of the realm hate Jaime Lannister because he is a Kingslayer. But he slew the mad King Aerys, who everyone agrees was insane and cruel. This helped Robert to become King, and the realm loves Robert. So, in a way, Jaime did a good deed by slaying the Mad King. Other than that he hasn't broken any oath (that the public knows of). So why do people in general mock and hate him?
I would not say that Jaime is "hated". More like, people who value honour, such as Ned Stark, Barristan Selmy or Brynden "the Blackfish" Tully, see him as an oathbreaker, and someone not to be trusted. The "smallfolk", i.e. the person on the street, may call him Kingslayer and mock him, painting him as a "bad guy", whereas someone like Ser Barristan is considered a good guy. There are many who do not dislike Jaime at all, or who do not simply care what he did to Aerys. Such as Robert himself, who I believe said
"Damn, Ned, someone had to kill Aerys!"
It is important to remember, though, that Jaime is also the son of one of the most influential houses in Westeros, and he is (was) skilled at arms and arrogant and rich, which is reason enough for him to attract some scorn, and then "Kingslayer" becomes a word to use against him.
It is also important to remember that Jaime is, in fact, worthy of a certain amount of hatred. He did push Bran from the window, trying to kill him, and he did kill Jory Cassel and the other Stark men in King's Landing, just to spite Ned. He did have a sexual relationship with his sister and commit treason against his king (again!), not once, but many times, and he is complicit in the conspiracy to usurp the throne from the rightful king (Robert/Stannis).
While he may have saved the people of King's Landing from the baptism of fire that Aerys planned for them, it does not excuse him from Kingslaying if he does not tell anyone, and just because you get pardoned by a grateful new king does not mean you earned the right to sulk and act like a spoiled brat for decades because you didn't feel like telling anyone about your heroism.
Jaime's story arc is one of redemption, no doubt, and I am guessing that he will eventually do something that will make us readers truly forgive him. And it does seem that it has something to do with Brienne and (Spoiler TV-series season 3+, ASOS)
and UnCat (introduced at the end of A Storm of Swords).
Probably because he is a knight of the Kingsguard, who are sworn to defend royal family, and the king in particular. From that link:
Supposedly the finest knights in the Seven Kingdoms, they are sworn to protect their king and the royal family with their own lives, to obey his commands, and to keep his secrets. They are sworn for life and are forbidden from owning land, taking a wife, or fathering children.
Jaime Lannister went directly against this vow and killed the very person he was supposed to protect.
This is speculation, but in King's Landing he may also not have been very popular following Robert's rebellion since his father, Tywin Lannister, sacked King's Landing just prior to Jaime killing the king.
Jaime's greatest crime (in the eyes of the Westerosi nobility) was oath breaking. Both the major religions of Westeros (The Faith of the Seven, and the Old Gods) regard oath breaking to be a very grievous sin. The Night's Watch swear a similar oath to the one sworn by the Kingsguard, and those who break it are executed. In the past, there have been members of the Kingsguard who forswore their oaths, and they were all killed.
When you think about it, the whole feudal structure of Westerosi nobility is highly dependent on the concept of staying loyal to your liege lord through thick and thin. Even King Robert with his well known hatred for the Targaryens forgave many lords who sided with them, as he regarded them as people who did the honorable thing to the very end.
Jaime not only did a dishonorable thing (never mind if it was the morally right thing) by breaking an oath, he did so while sullying the name of the Kingsguard in the worst way possible. The Kingsguard are an ancient order whose sole purpose was to protect the King, which Jaime did the complete opposite.
Another reason people hate him (though it might be minor) is that he's a Lannister. While most lords are too prudent to say this in public, the Lannisters are seen as opportunists. They waited out the whole war, staying neutral and not committing to any one side. While other lords fought and bled, Tywin Lannister stayed behind his walls then struck a sneak attack against the Mad King, wining an easy victory that propelled them to the new king's side.
Also, Jaime's own personality doesn't help. He is cocky, sarcastic, and quite rude to anyone and everyone.
Other than that he hasn't broken any oath (that the public knows of).
This is not true -- Jaime was a member of the Kingsguard, who laid their life to protect the life of the king. He did break a very serious oath. Probably on the level of
Walder Frey's betrayal of hospitality killing guest after granting food and shelter
Just because a king is called mad is no reason to just murder him -- the usual procedure is something like Robert's way to summon armies and beat him in battle. :)
And the people are indeed not aware of Jaime's side of the story
what I like so much in the books and even went through fairly on TV -- turning the "villain"-like character ready to kill children to protect his secret relation to a sensible hero eventually.
Many people also idolize him for his charisma and combative skills. Tyrion (I think) mentions how people follow Jaime into battle because he inspires them whereas they follow Tywin because they are being paid or just are afraid not to.
However, people do not know Jaime's information about the king so they had no idea why he did it or the time critical nature of his actions i.e. why he had to act right there and then!
It looks to everyone like Jaime realized that his father was going to win and in an act of disgusting cowardice slew the man he was sword to protect.
Hence many people do not trust anything he says, why should they? He broke one of the most solemn oaths it is possible to make.