As others said, debugging information will show it. More specifically, for ELF files:
readelf -w binary-name
will have an entry like:
<2><58>: Abbrev Number: 4 (DW_TAG_variable)
<59> DW_AT_name : i
<5b> DW_AT_decl_file : 1
<5c> DW_AT_decl_line : 2
<5d> DW_AT_type : <73>
<61> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
Without debugging information, locals don't retain their names. If the variable is a global, there will be a symbol that points to it:
objdump -t binary-name
0804a010 g O .data 00000004 i
Type information is lost there, but you can see the size is 4