The short answer is that you can only claim ownership/copyright for that what you have created yourself.
The longer answer is that if you contribute to an open source project, then you can claim copyright for the modifications you have made and the copyright on the rest of the code remains with their respective authors.
A source code license does not give you ownership of (the copy of) the code, but it only gives you certain rights on what you can do with the code.
How to indicate that you have contributed to the code depends a bit on the license under which the code is released and the project itself. Sometimes all the contributers to a file are mentioned in the copyright statement in that file, and sometimes there is a file called AUTHORS (or something similar) that lists all the contributers to the entire project.
If you are unsure how to claim your attribution, first check how it is done in the project you are contributing to, then check if there are any requirements imposed by the license and if that still doesn't help you, add your name to the copyright statement in the files you modified.