Technically, the UASF that will go live on August 1st isn't a hardfork (see What is the User Activated Softfork (UASF) proposal? How do its risks compare to hardforks?), but it may have still have a chainsplit.
When there is lack of consensus about the rules in the bitcoin network, there may be multiple blockchains, one blockchain following one set of rules, one following another. These two chains share the beginning of their chains, but there is a distinct point in time where they diverge. If the transaction where you received bitcoins happened before that point in time where they diverged, then your coins will be in both chains, so no matter which one is eventually selected, you'll be on the 'winning' side.
I should note that a chain split isn't necessarily ever resolved. There might be two ecosystems and networks that build around 2 different chains. In this case, your pre-split coins are available on both chains, and you could even spend them twice, once with one merchant on one side of the chain split and once with another merchant who is on the other side of the chain split!
The risk mainly comes in when you make transactions after a chain split. For example, if you are a merchant and you accept coins on side A of the chain split, but that transaction doesn't also get included on the other chain (side B), then sometime later the network gets back to consensus that chain B is the correct chain, then your coins on chain A are worthless. So it is risky to accept payment while the network lacks consensus.