Which of the two is correct and in what context can either be used? I read a poster where they had written that a course is running for a 4th time. However I have not read such a sentence before so if you please explain it for me.
Either phrase is correct and can be used interchangeably in that particular case. The one exception I might consider is if something is running for a 4th time within a certain span of time. For example,
the course is running for the 4th time in 2 years
would be correct, but
the course is running for a 4th time in 2 years
would be incorrect