A safe rule of thumb is to get to the airport at least 90 minutes before boarding (not departure). Especially if you aren't familiar with the layout of the airport or you want to have time to grab some food and trinkets, that buffer might come in handy. Generally, the security lines at ORD aren't that bad.