刚 itself already means 'just' (adverb- only a very short time before)
Example: "你刚回家,現在又要出去?" (you've just came home, now you have to go out again?)
刚刚 is a reduplication of 刚.
Example: "你刚刚回家,現在又要出去?" (you've just came home, now you have to go out again?)
Reduplication makes the descriptive feeling of the adjective stronger.
'才' itself also carries the meaning of 'just' (adverb- only a very short time before) like '刚' does.
Example: "你才回家,現在又要出去?" (you've just came home, now you have to go out again?)
Put two characters with similar meaning together and create a compound word can remove ambiguity. It is very common in coining Chinese words . For example: Both 刚 and 才 carry other meanings, (刚 also means 'hard'; 才 also means 'talent') but '刚才' can only mean 'just'.
In summary:
'刚才' is a compound word made up of '刚' and '才'. It still means 'just'
'刚刚' is a reduplication of '刚' It still means 'just' but carries a stronger emphasis (more immediate sense) than just a single syllable '刚' or '刚才'