You can book a flight up to 10-15 minutes before the check-in counter closes, which is ordinarily 2 to 3 hours before the scheduled departure.