sweetwater tavern is a great restaurant serving till midnight on weekdays and 2 am on weekends.
anytime cafe -- despite its name is not open at anytime. but till 4 generally. food has improved over the last year and is reasonably priced. $1 drink specials don't hurt either. late night delivery is also avail.
fornino has some hits, some misses on pizza but it's a reliable delivery option compared to other places near the bedford stop.
anna maria's is the late night pizza joint on bedford. usually following the bar schedule. some really like their style of pizza, i think it's pretty bad... but when you have no other options for a quick slice...
sunac market is open 24-hours as a last ditch option to get a sandwich made, pick up some pre-made sushi & salads, or buy some groceries.
brick oven pizza has the best pizza in williamsburg in my opinion. its on havemeyer between north 8th and north 7th. for late night pizza you could go to alligator lounge or capones to get FREE pizza with a purchase of one drink. alligator is on metropolitan and lorimor and capones is on north 9th and driggs.
Carmines on Graham Ave, also go with Sal's on Lorimer, or S. Cono and Son on Graham Ave for pizza. I rec. the slice of 'Grandma's' at Sal's, they often run out of it, that's how good it is. Thin and crunchy, olive oil laced crust, with both regular cheese and a dusting of Parmesean and herbs. Late night food at Marlow and Sons is spectacular. Although I am not sure how 'late night' you mean, they serve until midnight. Welcome to the 'burg.