In Legends, there are at least two incidents in the X-Wing series where low fuel was a threat, although they didn't run out of fuel in either case.
In the first incident, Gavin Darklighter blind jumped (in his X-wing) to escape a Star Destroyer; he didn't have enough fuel to return directly to base and had to resupply at the remote colony of Halanit.
In the second, the entirety of Wraith Squadron (twelve X-wings and a shuttle) are trapped in an uninhabited system when their navigation computers are wiped. Commander Antilles has to face a choice: he can either abandon the X-wings and use the shuttle's fuel supply to explore neighboring systems until they get back to civilization, or use it to run the shuttle's tractor beam to get their disabled ships under cover and make repairs. There isn't enough fuel to do both, or to go exploring with the X-wings.
Similarly, fuel supplies are a critical plot point in The Old Republic's Onslaught expansion. The Empire has stockpiled a large number of fuel tenders that allow their fleet to make a deep strike into Republic territory. The Republic fleets rushing to engage them need to make refueling stops, which sets up two of the main story missions as players are trying to protect or sabotage these stops.