The best way to tell if a hamster has passed away is to watch for any amount of breathing, according to hamsterific.com. Sudden inactivity from an otherwise healthy hamster can be a cause for alarm, but it may mean they are simply hibernating and their breathing will become very slow.
Another way to check if a hamster has passed away it to gently pick up the hamster. A hibernating hamster will be very cold to the touch, but its body will be limp. If a hamster has passed away, the body will be ice cold and it will be stiff and hard to the touch.