First you have to create secondary loop and use it.
// $categories = wp_get_post_categories($post->ID);
$categories = get_the_category($post->ID);
foreach ( $categories as $category ) {
echo $category->name;
}
Description
get_the_category( $post->ID );
This tag may be used outside The Loop by passing a post id as the parameter.
Note: This function only returns results from the default “category” taxonomy. For custom taxonomies use get_the_terms().