Just as in English we use 'sir' or 'madam' in order to express respect or regard for someone or to indicate a formal relation with someone, people in Japan use certain honorifics. These are used either with the first name or the last name, but not as per the gender of the person who is being addressed, so they are not gender-specific. In case of an informal relationship, such as while addressing the younger members of the family or maybe while addressing classmates or teammates in a sports team and so on, these honorifics can be dropped; just as one would drop the 'Mrs, Mr, Ms, Sir or Madam' tag in the English language.
Pronounced 'Han' in the Kansai dialect, it is used in order to address someone respectfully. This Japanese honorific can also be used in several other ways besides being used with names. It can be used as a workplace noun such as video store + san, or maybe bookstore + san. This san can also be used with the names of animals. In Japan, even animals, especially pet animals, are referred to as san. San is also used with company names--for example if you have a company called ABC Ltd, then some other company will refer to your company as ABC Ltd san.
If you find someone endearing, then you can address him/her as chan. This term is generally used for babies, small kids, a cute animal, for lovers, or for very close friends. Do not use this term for people of higher authority or for people with whom you share a formal relationship.
In Japanese, the term sensei means 'former born' and is usually used to address teachers, doctors or politicians and so on. In short, this term is used to show respect to people who have made a mark in their respective fields. You can use this honorific either as a suffix or even as a stand alone title.
While writing a formal letter, giving a formal speech, talking to a person with whom you are not familiar, or a person who you have never met, shi is used. You will notice the use of this term mainly by news readers while they are reading out the news. This term can also be used in legal documents or academic journals.
If you have to address your seniors in schools or colleges, or maybe in your company or sports club, then you use the term senpai. Students will call their seniors (i.e. students of the higher grade, senpai), but not their classmates or students from lower grades.
This is a more respectful version of the Japanese honorific, san. It is used to address people who belong to a much higher post, or maybe sometimes it is also used to refer to customers or people whom you admire a lot. This term can also be used to express empathy towards someone because of their hardships or while expressing regret for some mistake.
Kun is used when a person of a higher status talks to a person of a lower status, or while addressing male children or male teenagers. Females can also refer to males with whom they are emotionally attached as kun.
These are the various Japanese honorifics which are commonly used in Japan. Next time you hear any of your Japanese friends referring to you using any of these expressions, you will know what it means. You can also address your Japanese clients (if any) using these honorifics and impress them.