So i've just started learning guitar chords, but i'm having trouble playing anything because I don't understand how long you are supposed to play a chord. I know that it's different for every song, but does anyone have any advice for understanding how long i'm supposed to play a chord before changing to the next one?
It is up to you.
Tempo of the song + timing of the progression would dictate how long you let it ring for each strum.

There's no single answer really. Like you said it varies between each song. Listen to the song a lot and use a metronome to gauge your timing correctly for chord changes. That's my advice.
Music Notation. Is a good tool to visualize the length of things

Imagine you are playing a 2 Chord a C and a G, through out 4/4.
4/4 means = in each bar you will have 4 beats and that each beat is count as a quarter note

By this i mean, 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Each quarter note as the length value of 1, so when you count till 4. You start a new bar.
An half note has the length value of 2, so when you count 2 half notes, the bar will be done. 1 Half-Note = 2 Quarter Notes. 2 Half-Notes = 4 Quarter Notes.
An Whole Note has the length value of 4. so would strike at beat 1 and let it ring until beat 4. 1 Whole-Note = 4 Quarter Notes.
An Eighth Note has the length value of 0,5, so in one beat you would strike the chord twice. 2 eighth notes = 1 Quater note
An Sixteenth Note has the length value of 0,25, so in one beat you would strike a chord 4 times. 4 sixteenth notes = 1 Quater note; 16th are often use in funk.
Etc...

Now if you change chords in every bar, all you need to know its the value of the chord, length wise.
If you would give the chord the value of the 1 symbol in the image (Whole Note)
It would play out something like.
C--------|G-------|C--------|G-------|
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Chaging the value to the 2nd symbol (half note)
It would play something like.
C--|C--| G--|G--| C--|C--| G--|G--|
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
You would strike it every 2 beats.
The next symbol is the Quarter Note. Which means you will be stroking every single beat.
CCCC GGGG CCCC GGGG
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Then you have the Eighth Note. Which means that in every beat you will stroke the note twice
So on and So on.....

This is assuming you are changing the chord in every single bar, because you can have change inside the same bar.
C--|GG
1 2 3 4
You would Strike C with the length of a Half Note and G twice with the length of a Quarter Note.
Etc, Etc

If you happen to have Guitar Pro, you can see this in motion very clearly.
Last edited by renatofrmsantos at Nov 4, 2016,
Listen to the song and find out! It's hard to hear specific things at first, but getting your ears into the music is important and fundamental to becoming a musician.