As long as you prepare enough water and food for it, the hamster will generally not die if left unattended for a month after going home for the holidays. However, it is not recommended to leave your hamster alone in one place for a long time, even if you have prepared enough water and food in advance. If not replaced for a long time, food and water will easily deteriorate, and the hamster will easily die after use.
If it is because of something unavoidable, you can only rest assured that it has all the necessities of life. It's best to set up surveillance and give your friend a spare key, just in case these fools get themselves stuck in a crack and can't get out for two or three days.