Hello,
You can download the data for file based item types. File based items include CSV, Service Definition, Shapefile, File Geodatabase, Powerpoint, etc.
Hosted feature layers and map image layers are not file based items, so you cannot use the item.download() method to download their data.
For hosted feature layers, you can use one of the following ways to get the data:
1) Use extract_data tool from the features.manage_data module (doc: arcgis.features.manage_data module — arcgis 1.0 documentation). It's easy to use, couple examples:
from arcgis.features.manage_data import extract_data
csv_lyr = gis.content.get('c8bc7d3c3b60415e9845bc00dcd777ed')
outputgdb = extract_data([csv_lyr])
outputgdb.download('C:\\xc')
Out[]: 'C:\\xc\\extract_data_20161025204926.zip'
# you can also specify the format:
outputcsv = extract_data([csv_lyr], data_format='CSV')
2) You can get the related data item for the layer, and download the data item used to publish the layer:
relitems = layer_item.related_items("Service2Data")
relitems[0].download()
Hope this helps,
Rohit