Freshly pumped breast milk will usually last about 6-8 hours at room temperature. This is assuming you don't have lipase issues which break down your milk faster than normal.
Freshly pumped breast milk stored in a cooler with an ice pack is good for about 12 hours before it needs to be refrigerated or giving to your baby. This is a very loose estimate since cooler and ice pack temps can vary greatly, but it gives you a good idea for instances like pumping at work where you do not have a refrigerator on hand.
Breast milk that has been frozen and then thawed has a MUCH shorter lifespan since some of the breast milk is broken down in the freezing process. It is best to defrost your breast milk slowly in the refrigerator, which takes about 12 hours. Once the breast milk is completely thawed it should be used within 24 hours.
Thawed breast milk has a lifespan of about 2 hours at room temperature, after 2 hours it should be discarded.
Once heated (in a glass of warm water or a bottle warmer, never in the microwave) breast milk should be given within the two hour time frame or be discarded as well. Regardless if previously refrigerated or thawed.
Once a bottle has been partially used, it is best to only offer the same bottle within the original two hour time frame that the breast milk was heated or served. Much controversy exists here between LCs, Moms, Experts, etc. because little research exists at the moment. To avoid bacteria risks we choose to recommend staying within the two hour time frame.
All this being said, it's still best if you plan to freeze the milk to do so within 24 hours and if you're not planning on using fresh milk to refrigerate it as soon as possible.
There is little research on expressed milk and thawing/use, so please remember these are just guidelines. You milk should not taste sour, most of the time it has a sweeter taste/smell to it. Although, some mothers have reported a soapy smell/taste once thawed, which is thought to be safe as long as baby will drink it. Also, please note these these guidelines are for full-term healthy babies.