pumped milk

M 👱🏼‍♀️
What r the rules for how long I can leave out and refridgerating after? Ex...I pumped thought she'd wake up so left it out, can I refridgerate? 
What about if I warm a bottle and she falls back asleep? After an hour do I pitch?