When a villagers' GUI is opened, you will see 'Hearts' and a number behind it. This number indicates your popularity. Your popularity changes by interacting with the villager. When the villager likes the interaction, your popularity will go up, and vice versa. Your popularity can drop under 0, and when this happens the villager dislikes you, and will be rude to you. Whether the villager likes your interaction can be dependent on its character train, current mood and your current popularity.
You start off with a few points.
If your popularity is a negative number, the villager will be rude to you in the chat. When this happens, it will be difficult to get your popularity back up again, certainly if your low popularity is due to its character trait.
Kissing a villager is only recommended when your popularity is AT LEAST 50. If they dislike it your popularity will drop.
It is a good idea to take a villagers mood into account when interacting. When it's mood is for example 'agitated', it's not a good idea to tell jokes.
When your popularity is above 50, the 'Shake hand' option will change in 'High five'.
You can marry a villager when your popularity is above 100. If your popularity is beneath 100 the villager will refuse and your popularity will drop drastically.
Becoming a monarch automatically sets your popularity to 100, unless your popularity is above 100 already.