There is not an exact difference because sometimes there is overlap (e.g. where fast trains mean two cities are only a short travel time apart, some people may be daily inter-city commuters, which blurs the division).
Commuter trains are mainly used by people making daily journeys to work, etc. They often travel relatively short distances and make many stops on route. Seats are not usually reservable and seating may be designed to maximise number of people carried rather than comfort. There may be relatively little luggage space since most passengers may have only briefcases or bags of similar size.
Inter-city trains are designed for longer journeys at higher speeds, with passengers being on-board for longer periods. They often have reservable seating, fares sold in advance, more comfortable seating, more luggage space, and sometimes on-board catering. Sleeper trains, which have cabins with beds and where passengers will be on board all night or longer, are perhaps an extreme example (e.g. the Paris-Moscow sleeper takes two nights and the intervening day to complete the journey).
Where cities are fairly close together, there may be a number of people who travel between them every day, and the difference between inter-city and commuter trains may come down to whether they run none-stop between centres or stop at intermediate stations. E.g. in England the cities of Liverpool and Manchester are only 30 miles apart and the faster trains cover the journey in 33 mins, with slow trains calling at suburban and village stations along the way taking twice as long, and London and Ashford, Kent are 60 miles apart but the train journey takes 38 mins (140mph trains running on the London-Paris high-speed line).