Index characterization for free boundary minimal surfaces