Rule No.1: before and after every practice session always stretch you hands, wrists, fingers and forearms. Check some YT videos for this stretch exercises because they really help in the long run.
Problems with cramping are coming from bad technique and not enough finger strength. You are probably using way to much power to press down the strings and this is tiring your muscles quickly. Good news is this will all improve in time if you practice every day but don’t practice through pain. Stop, relax and continue with different song or practice some scales up and down the neck. This will greatly improve your finger strength and coordination.
Lastly make sure your instrument has proper setup, high action for beginners can cause a lot of trouble.