You push when there isn't enough light: indoors, at night, or to freeze motion with a faster shutter. The whole roll has to be shot at the same speed, because the whole roll gets the same development.
Longer development brings up the mid-tones and highlights, but it can't create detail where the film got too little light. Pushed film shows more contrast, more grain and darker, emptier shadows. That look is sometimes the point.
Black-and-white datasheets often give push times: Kodak lists Tri-X at EI 1600 and 3200. Colour negative (C-41) and slide film (E-6) can be pushed too. Tell the lab when you hand in the roll; most charge a little extra per stop.