Gilbert was elected judge of the Shelby County Court in 1910.
He was reelected in 1914 and served until his resignation in 1917.
Gilbert was elected as a Democrat to the Sixty-seventh and to the three succeeding Congresses (March 4, 1921 – March 3, 1929).
He was an unsuccessful candidate for reelection in 1928 to the Seventy-first Congress.
He served as member of the Kentucky House of Representatives in 1929.
Gilbert was elected to the Seventy-second Congress (March 4, 1931 – March 3, 1933).
He was not a candidate for renomination in 1932.
He resumed the practice of law in Shelbyville, Kentucky.
He again served in the Kentucky House of Representatives in 1933.