It depends on the setup of your hammock and your campsite. Typically you can easily place your backpack beneath your hammock where it will be sheltered from the elements and also be easily accessible to you.
If you’d rather keep your bag off the floor however there are other ingenious ways of positioning your bag. For example, it’s possible, depending on the type of bag you’re using and how heavy it is, to strap your bag onto the hammock straps to keep it raised up off the ground if you’re concerned about scavenging critters. You can also find ways to strap it to the side of your hammock, or for smaller bags, it’s even possible to put them on the hammock with you near your feet. It just depends on how big you, your hammock, and your backpack is.
Some newer hammock designs have added storage capacity in very unique and innovative ways, such as adding under sheets to provide both insulation and storage capacity, allowing you to keep your belongings better protected and also using them for added insulation.
You can get as creative as you like when it comes to storing your equipment, and you will often find yourself having to adapt to the environment you’re camping in. Using your knowledge of your campsite and your equipment it should be no trouble to find a safe and easy place to keep your backpack secure.