A temple is a PZ (protection zone) where players are sent to when they have died or are teleported. Every major city has such a temple. Rookgaard's temple is the only one that's not a PZ, whereas the temple on the Plains of Havoc is the only temple at which players cannot respawn and cannot be teleported to. Apart from these 2 temples, all other temples are also Resting Areas.
Every major city's temple has a portal you can enter to set that city as your home city. When you die, you will instead be teleported to that city. One thing a smart player wants to keep in mind is to set the nearest city to their hunting area as their home, that way they are closer to their body if things go badly.
In addition, every temple has an NPC that will heal players that are below 50 health. They also remove poison, burning, dazzle, freezing, electrification, drown, paralyzation and curse effects or any other similar status from players.