When is the cutoff for flying in a plane while pregnant?

Vi
Is it the entire last trimester?  I heard it was just the last month that you are "grounded."