What do you think of me turning the paper that Tom wrote in to the teacher?
Did you help write the paper at all?
No, Tom wrote the whole thing.
If you did not put any work into the paper that you turned in as your own, then you have just stolen credit for someone else's work. Be honest and confess to your teacher what happened.
We do not want to get anyone else in trouble.
You shouldn't claim his work for your own, and you should let the teacher know that it wasn't from you. It would look bad to others if you attempted to pass off work that you had no hand in as your own.