In terms of Machine Learning (ML), an epoch defines a single loop of the entire training database. In other words, it takes several epochs while training a neural network. Feeding the neural network with diverse data over many epochs offers a better result for the test data.
Over to a blockchain network, a specific period of time is defined by epoch. The epoch is used to specify any specific event that would occur in the network. This includes when the next incentives will be distributed, or the time when new validators will be assigned.
Each blockchain network has a different protocol against epochs. Although the idea remains the same. It defines a set time for a certain number of blocks to complete on the chain. For instance, in Ethereum (ETH) one epoch is defined by the time taken for 30,000 blocks to complete the chain.