You will know your derailleur hanger is bent by looking at the derailleur. If it is not pointing straight, then that would mean your hanger needs to be replaced. The easiest way to tell this is by standing in the front of your bike facing to the back, and lining up the derailleur with the frame of your bike, if it doesn't look straight, it is time to replace.