If i play a melody with a static chord rhythm of 1 the tonic chord (G major in this case) but if i end the melody on a non chord tone, lets say a C note. What is the term for that? The last note of a melody being a non chord tone.
It depends on which chord you end on.
- V: Half cadence
- vi: Deceptive (or interrupted) cadence
In other cases you might call it a weak cadence, or simply not refer to it as a cadence at all. "Hanging chord" might describe it, or "suspension" might describe what it is doing.
Sounds like the penultimate chord becomes a sus4. In C, the V chord is G, or G7, but if the melody is C at that point, the harmony overall will be Gsus4, or more properly, if the whole G chord, inc. its B note, is played, then the harmony becomes G11, or Gadd4, or G7sus, maybe.It's anticipating the home/root note.
In your example, the non chord tone anticipates a future chord, this is an anticipation.
The other way round is a suspension. https://en.wikipedia.org/wiki/Suspension_(music)
To verify if that's actually relevant to your specific melody though, we'd need an example, written or recorded, of the melody to which you're referring
So, your melody's phrase is cadencing to the tonic while the dominant is still playing in the accompaniment, and that dominant resolves to the tonic after the melody ends (goes silent?).
There's no specific term for it, but unresolved anticipation probably describes it quite well if the melody arrived there by a process of ellipsis, that is, by leaving something out of the middle of the phrase (possibly by shortening the expected duration of the penultimate melody note, although there is more than one way to skin that cat).
There's another way you might have got there. Let's consider for a moment the situation where the accompaniment ends on the tonic while the melodic phrase is stretched (perhaps by internal expansion of the phrase) so that a harmony note from the dominant is still sounding in the melody while the accompaniment finishes at the expected time: you might consider this a suspension with delayed resolution. Now, if you flip the roles so that the accompaniment's phrase is stretched instead of the melody's, and the notes of the accompaniment all resolve by step, then it might be possible to consider the accompaniment's movement as a multiple delayed-resolution suspension instead.
That's probably why none of us have a specific term for what you're doing: how the dissonance is perceived is going to depend somewhat on voice leading, and quite a bit on the listeners' expectations of phrase length and rhythm.
Now, you didn't say specifically whether whether we're talking about the phrase endings of the melody and accompaniment of the very final phrase of the work, or whether another phrase follows. If the latter is the case, and one (or more) voice(s) is (are) ending a phrase and beginning a new one while the other voice(s) is (are) still finishing the first phrase, then the process is called dovetailing. Note that whether these phrase endings involve dissonance is immaterial to dovetailing - they may or may not - so explaining what you are doing here still needs a bit of an analytical eye.