Is it bad to workout until?

A gym teacher once told me that you should work out until you can't do it anymore then do five more of what ever your doing is this good or bad I've been doing it lately and it seems to be working is there anything bad that can happen from doing this I was told this in middle school I'm 20 now and am trying to loose pregnancy weight my son is 5 months old and I just want to loose the weight I have 20 lbs till my goal weight
Is it bad to workout until?
Post Opinion