The directed movement of ATP from one side of a membrane to the other into or out of a mitochondrion.