PEP is very effective, but it is not 100%, so yes, there is a possibility that you could get HIV from this event. You should see a doctor for PEP and not rely on getting it from a friend. You need to make sure it is not expired medication and that the dose is right for you.
After you finish PEP, you can test with a 4th-generation test 28 days later to know your status. If you cannot get a 4th-generation test, you will need to wait 90 days after finishing PEP to test.