Yes, you can absolutely use WordPress to create a paywall to hide your premium content. We recommend using the MemberPress plugin which has this functionality.
It lets you control the number of free views after which you can require readers to pay to join your site similar to popular sites like NY Times, and others.
Here’s our detailed guide on how to create a paywall in WordPress.