High school math teacher and part time local college adjunct faculty here:
First, on a math test where you show work, it's often incredibly obvious when people copy. My 16-year-old TA that grades homework hands me cheaters' papers all the time.
In HS, it's an automatic 0 on the test, with a phone call or email to parents. In college, automatic 0 and possibly referred to judiciary board where they investigate and decide if you get to stay in school or not. Colleges and universities typically don't like to attach their name to the degree of a known cheater. Just saying.
Oh, and if I catch it during the exam, I say nothing. Just make note of it, document, but don't confront, because I don't want to disrupt the presumedly academically honest students that are in the room taking the exam.
So, you definitely fucked up. Pray your professor is blind, merciful, or lazy. I'd wish you luck, but I won't. You know what you did.