How to get product name by id from commerce order?

A product is an entity, so you can use entity_load().

$product = entity_load('commerce_product', $product_id);
$title = $product->title;

Commerce provides its own shortcut, though:

$product = commerce_product_load($product_id);
$title = $product->title;