How to set password from frontend if have activation key and user login in url in wordpress?

The function you need is wp_set_password( $_POST['new_password'], $user_ID)

This will update the user with new password.