You should use get_the_categories()
Returns an array of objects, one object for each category assigned to the post. This tag may be used outside The Loop by passing a post id as the parameter.
$categories = get_the_categories();
var_dump( $categories );