I build over the last mile or so. I do the same often on my training runs so I have an idea of how far out I can do it. If I have a lot left I start a little early and go pretty hard. If I'm a little short I ramp up as best I can. Either way I'm as wide open as I can be before the finish.
I sprint at the end of every race. How far from the finish I start sprinting tends to vary. If there's someone I'm trying to catch or if someone's trying to pass me, that usually triggers sprinting. However, I've found that if I've really paced myself well, it's hard to sprint for very long. On my best 10k run, I started sprinting at mile marker 6 because I heard another racer approaching me and I never thought 0.2 miles could seem so long.