get_query_var() and permalinks

WordPress rewrites rules invisibly translate pretty permalinks to the non-pretty format internally, and set the appropriate variables and load the requested page, you don’t need to do anything in your template to load posts from a category on a category page.

The cat query var specifically will be set to the ID of the requested category, not the name.

That said, this:

$my_category = get_query_var('cat');
echo $my_category;

should print the selected category ID on a category page. If it’s not, we’d have to see your code to help you further.

Also, have a look at the $wp_query global to see all query vars set on a particular page:

global $wp_query
print_r($wp_query);