Yeah, it's not even difficult to prove this, which doesn't make it not a cool fact!
First, note that prime numbers (bigger than 3) can't be divisible by six, since then they wouldn't be prime. Nor could they have a remainder of 2 or 4 when divided by six, since then they would be even. So the only other remainders possible are 1,3,5. But if it's divisible by six, then it's also divisible by three, and adding three to it (ie, the remainder 3 option) would *still* make it divisible by three. Hence the only remainder possible is 1 or 5, or as you say 6n-1 and 6n+1.
Also, it follows from this that all prime numbers squared are one more or less than a multiple of 24:
(6n-1)^2 = 36n^2 - 12n + 1 = 12 (3n^2-n)+1
(6n+1)^2 = 36n^2 + 12n + 1 = 12 (3n^2+n)+1
showing that the squares are one more or less than a multiple of 12. But 3n^2 is even if n is even, and odd if n is odd, so that 3n^2 + n and 3n^2 - n are both always even.
Hence, all squares of primes are one more or less than a multiple of 12*2 = 24.
Fun observation TTT :)