At the top of the hierarchy of royal titles is, of course, the king and queen. They may alternately be called emperor and empress if they rule over an empire rather than a country. (This is a somewhat antiquated notion that has more to do with semantics than any functional difference.) The relatives of the king and queen who are themselves in line to take the crown someday are usually known as princes and princesses. This group can include siblings, children and grandchildren, or even cousins. The specifics vary from one country to the next, depending on the country's rules of succession.
There are other royal titles (or they may be simply noble titles if the country only considers one family "royal") such as duke, duchess, baron, count and viscount, among others. Each country has its own system of ranking and naming nobles.
These titles can be hereditary. That is, if your mother or father was a duchess or a duke, the title is passed on to you when she or he dies, and you will someday pass it on to your own heirs. This also follows rules of succession. The title may be dissolved if there is no heir, or it can be passed to a new family. A title can also be dissolved if the person holding it happens to be in line of succession for the crown and becomes king. In that case, the title is said to be absorbed by the crown.
There are non-hereditary titles which are sometimes known as life peerages. These titles are bestowed upon a specific person by the reigning king or queen, and only last for the lifetime of the title holder. Their children don't inherit the title.
Now that we know how royal titles work, let's find out what the king and queen actually do.