Word production is a very large chapter in Greek grammar and it is impossible to exhaust here all the rules that govern it.
There is a great variety of productive endings. There are also many conversions that may happen in the root of the word as a new one is produced. Ancient Greek grammar is involved as well as many phonological rules.
You can not, therefore, learn some rules that apply to all words, especially if you are a novice. All you can learn is to recognize the special declaration/meaning of some endings.
- της. It declares the person that does something. Ex: εκπαιδευτής (trainer), κριτής (judge)
- τήριο. It declares place. Ex: εργαστήριο (lab), κομμωτήριο (hairdresser shop).
- ιμο. It declares action. Ex: ψάξιμο (searching).
- μα. It declares the result of an action. Ex: σφάλμα (mistake).
Since you asked about “γράφω”, the following nouns are produced:
γράψιμο -> action
γραφή -> action
γράμμα -> result of an action
γραμμή -> result of an action
γραφείο -> noun that declares place
γραφέας -> person that makes the action
γραφίδα -> instrument of mean for the action
You will notice that the root of the word “γράφω” changes to γραψ- , γραφ- or γραμ-. This has to do mainly with the phonological rules, like what letter follows the root part.