Movies are 'classified' or 'rated' when they are released for public showings or in form like a dvd for sale by a body that is approved by each country the movie is released in. The criteria they use will change from country to country depending on cultural norms.
Organizations which have public documents describing their decisions include:
These organizations around the world may be government bodies, or are just 'by convention' used in those countries. For example in the UK it is the local authorities (such as counties) in each area that actually allow movies to be shown - but by convention they delegate the rating and/or whether a movie should be 'cut' to meet a certain rating to the BBFC. The BBFC has an additional responsibility under UK law to rate recorded content for showing in homes, and ensuring that the content is compliant with UK law.
A list of certifications by country can found on Wikipedia
You ask "who decides" ... ultimately it is these classification organizations that decide the final rating, but it is usually done in conjunction with the movie production team and distributors. They will have a 'target' rating for the movie and will make this known to the classifiers in advance. The classifiers (if they have concerns about the movie at that classification) will advise on how the movie could be edited such that they will give it a more open rating.