Thank you very much, it has worked for me.
I share my final solution for those who have asked me the same thing:
add_action( 'wp_enqueue_scripts', function() {
if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
wp_register_style( 'custom-style',
get_template_directory_uri() . '/css/custom-style.css',
array(),
'20190118',
'all' );
wp_enqueue_style( 'custom-style' );
}
} );