Yes, you need to update WordPress in order to keep up with important security updates. Security patches are also released for old versions of WordPress, so, for example, it is possible to stay on WordPress 4 by updating your site each time a security update is released.