What age do baseball players retire?

They usually retire from the late 30's to the mid-40's