This is possible by using Composite Gates in Qiskit. With composite gates, you can create a circuit of gates, turn that circuit into an Instruction, and attach it to a new circuit which will perform the gates that were within your old circuit. Here is an example:
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, name='bell')
qc.h(0)
qc.cx(0, 1)
custom_gate = qc.to_instruction()
new_circ = QuantumCircuit(2)
# Append custom gate. The parameters are the Instruction you made, and the qubits you will use with it
new_circ.append(custom_gate, [0, 1])
print(new_circ)
'''
This is the output
┌───────┐
q_0: |0>┤0 ├
│ bell │
q_1: |0>┤1 ├
└───────┘
'''
The to_instruction()
method from QuantumCircuit
turns your circuit into an instruction which can then be appended to another circuit in the future. It appears as a single gate on the new circuit, which you can name to make it more organized. When the new circuit is executed, it will run this composite gate, which will make it run through the bell state code we set earlier.
For more information about composite gates, you can go to this tutorial and scroll down to the "Composite Gates" section