The College Board has strict policies on what constitutes misconduct during the administering of an AP exam. You can read all of them here, but I will highlight some of the most important ones for you. Obviously, it would be considered cheating if you were to look at someone else's test booklet, to somehow obtain the questions before the test, or to use your computer or cell phone during any breaks to get answers. You are also not allowed to work on any section of the test other than the one you are supposed to be working on. It's actually also against policy to even talk about the questions on the exam with friends afterwards, whether they took the exam or not.
If the College Board finds out that there was any misconduct during a testing session, they will usually cancel all the scores of everyone in the room to ensure that no collusion (or "group cheating") was going on, or that the cheating didn't affect anyone else in the room. The official course of action by the College Board is to cancel the score, which would not appear on your official score report. However, there is a chance that your school district would put this serious instance of cheating, like any other serious offense, onto your permanent record, so colleges still might see it. All in all, it's not worth the risk!