Once it sets we always suggest keeping it in the fridge to keep it nice and cold as well as fresh.
If it is an environment that is hot it might re-melt again to become liquid. It should not spoil if left out for a long period of time as long as it is in a cool environment.
Preferably refrigerate to keep it set and fresh for longer.
As pudding is made using Milk / Milk Substitute, refrigeration is recommended to prevent spoilage.